I've been using the supabase-js for my application and I stumbled upon a problem. I want to get a table like this
Post | TotalLikes |
---|---|
0001 | 3 |
0002 | 12 |
0005 | 0 |
The SQL-query for this would be:
SELECT Post, COUNT(*) as TotalLikes from "Votes"
where positive_vote = true
GROUP BY Post
I found this stackoverflow: How to get "COUNT(*)" in Supabase
however this does not help in this case.
Any help/suggestion is welcome