I have 2 counters. If callback data is positive number comes, I increase the likes counter by 1, if negative, I increase the dislikes counter by 1, respectively. But my current code throws a syntax error.
cursor.execute("""
UPDATE posts SET
likes_count = CASE WHEN (?) > 0 THEN
likes_count = likes_count + 1 ELSE likes_count END
dislikes_count = CASE WHEN (?) < 0 THEN
dislikes_count = dislikes_count + 1 ELSE dislikes_count END
WHERE id = ?""", (data,abs(data),))