© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
SupabaseS
Supabase•13mo ago•
2 replies
Alvin Joy

Order by multiple columns in supabase

I saw a pull request on postrest-py (https://github.com/supabase/postgrest-py/pull/495) which fixes this issue. Is there a workaround for javascript?
The query below does not work:
const { data, error } = await supabase
  .from('cities')
  .select('name, country_id')
  .order('id', { ascending: false })
  .order('name', { ascending: false })
const { data, error } = await supabase
  .from('cities')
  .select('name, country_id')
  .order('id', { ascending: false })
  .order('name', { ascending: false })
GitHub
fix: fixed the 'order' method for 'BaseSelectRequestBuilder' by Nik...
Fixed the 'order' method for 'BaseSelectRequestBuilder' to support multiple sorting criteria and handle sorting on foreign tables.
What kind of change does this PR i...
fix: fixed the 'order' method for 'BaseSelectRequestBuilder' by Nik...
Supabase banner
SupabaseJoin
Supabase gives you the tools, documentation, and community that makes managing databases, authentication, and backend infrastructure a lot less overwhelming.
45,816Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements

Similar Threads

how to order by multiple columns in supabase-python?
SupabaseSSupabase / help-and-questions
3y ago
Re-order columns in Supabase Studio?
SupabaseSSupabase / help-and-questions
4y ago
Identity uniqueness by multiple columns or keys
SupabaseSSupabase / help-and-questions
4y ago
How to query a table by multiple columns
SupabaseSSupabase / help-and-questions
4y ago