Ahmad Khalafalla
Ahmad Khalafalla

Reputation: 47

How to do custom query in supabase postgresql?

How to do this query with supabase postgreSQL ?

SELECT Words.word, COUNT(audios.id) AS count
FROM Words 
LEFT OUTER JOIN audios ON audios.word_id = words.id
GROUP BY words.id ORDER BY count DESC;

Upvotes: 0

Views: 2817

Answers (1)

Andrew Smith
Andrew Smith

Reputation: 1841

You would create a Postgres function and then call it with the .rpc method of the supabase-js library. You can read more about this in the documentation.

Upvotes: 1

Related Questions