© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
SupabaseS
Supabase•4y ago•
13 replies
Amr

Join table multiple times ?

I have this table
stops
stops

- id - name
|- 1 - Cairo
|- 2 - Giza
- id - name
|- 1 - Cairo
|- 2 - Giza

and another table
trips
trips

- id - departure - arrival
|- 1 -     1     -   2
- id - departure - arrival
|- 1 -     1     -   2

the
departure
departure
column is a foreign key to
stops.id
stops.id
and
arrival
arrival
to the same
stops.id
stops.id
key.

Now I can't select from
trips
trips
while using
left join
left join
because of this error:

Failed to run sql query: table name "stops" specified more than once
Failed to run sql query: table name "stops" specified more than once


Of course I tried this first in SQL editor in supabase, but I'll use the js client for the project.
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

Table join only returning 1 matching column instead of multiple
SupabaseSSupabase / help-and-questions
4y ago
RLS With Join Table
SupabaseSSupabase / help-and-questions
4y ago
Join through another table
SupabaseSSupabase / help-and-questions
4y ago
Query table with multiple cols with same foreign key. Join tables.
SupabaseSSupabase / help-and-questions
3y ago