How to GROUP BY? #19517
Answered
by
steve-chavez
johannbuscail
asked this question in
Questions
How to GROUP BY?
#19517
-
Hello, I was wondering if there was a way with Example of how i would imagine it: const { data: projects, error } = await supabase
.from("landing_pages")
.select(`project_id, projects (id, name, description)`)
.group('project_id'); |
Beta Was this translation helpful? Give feedback.
Answered by
steve-chavez
Jan 26, 2024
Replies: 2 comments 13 replies
-
No. You need to use a view or rpc call to a postgres function and return what you want. |
Beta Was this translation helpful? Give feedback.
0 replies
-
PostgREST v12 supports aggregate functions, this is not yet supported on Supabase but there will be an announcement next week. |
Beta Was this translation helpful? Give feedback.
13 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
It needs to be enabled manually.
See https://postgrest.org/en/v12.0/references/configuration.html#db-aggregates-enabled