© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
SupabaseS
Supabase•3y ago•
3 replies
alaninnovates

How to write out query with supabase sql

How should I express such a query with the supabase js client?
SELECT
    f1.form_structure AS form_structure_1,
    f2.form_structure AS form_structure_2,
    c.*
FROM
    competitions c
LEFT JOIN
    forms f1 ON c.form_id = f1.id
LEFT JOIN
    forms f2 ON c.secondary_form_id = f2.id;
SELECT
    f1.form_structure AS form_structure_1,
    f2.form_structure AS form_structure_2,
    c.*
FROM
    competitions c
LEFT JOIN
    forms f1 ON c.form_id = f1.id
LEFT JOIN
    forms f2 ON c.secondary_form_id = f2.id;

both form_id and secondary_form_id foreign key to the forms table.

ive gotten to
    const {data, error} = await supabase
      .from('competitions')
      .select('*, 
    const {data, error} = await supabase
      .from('competitions')
      .select('*, 

and now im stuck as to what to put after the comma
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

SQL to Supabase query
SupabaseSSupabase / help-and-questions
3y ago
issues with sql query
SupabaseSSupabase / help-and-questions
4y ago
SQL to supabase orm
SupabaseSSupabase / help-and-questions
3y ago
Get supabase project name using SQL query
SupabaseSSupabase / help-and-questions
4y ago