Recently, while working with my application and utilizing the supabase-js library, I encountered a challenge. My goal is to display a table similar to the one below:
Post | TotalLikes |
---|---|
0001 | 3 |
0002 | 12 |
0005 | 0 |
In order to achieve this table structure, the SQL-query required would be as follows:
SELECT Post, COUNT(*) as TotalLikes from "Votes"
where positive_vote = true
GROUP BY Post
While researching solutions, I came across a related inquiry on Stack Overflow: How to get "COUNT(*)" in Supabase
However, the information provided did not directly address my current issue. Therefore, any assistance or suggestions would be greatly appreciated.