Count the occurrences of DISTINCT values using supabase

Viewed 1680

I want alternative supabase code for this SQL command

SELECT order_date,COUNT(*) as count
FROM orders
GROUP BY order_date
ORDER BY order_date Desc;

What I am trying to do is, I want the number of orders of each day. This is how my table looks likeenter image description here

Since I am using supabase, I don't find any alternative for group by query. Can anyone please help?

1 Answers

Add this to a view or stored procedure, then it can be called via the API supabace.rpc()

Related