Coding Global Background
Coding Global

why does this not work

Archived 2 years ago
1 messages
1 members
Created 3 years ago
Updated 3 years ago
Open in Discord
X
xTTLegend
Verified
It works in my SQL Console in DBeaver, but this does not work and sets everything to zero.

i use modernc.org/sqlite

func calculateLikes() {
    _, err := db.Exec(`UPDATE notes SET Upvotes = (SELECT COUNT(*) FROM reactions WHERE reactions.Tags LIKE '%e","' || notes.ID || '%' AND reactions.Content = '+')`)
    if err != nil {
        log.Fatal(err)
    }
}

Replies (1)