How can I double join in a query? I have a table c...
# help
n
How can I double join in a query? I have a table called
images
which belongs to a
snapshot
which belongs to a
category
. (Snapshot is just an instance from when I scrape from the website). I want to find all images for a certain category by name.
n
Hello @nahtnam! This thread has been automatically created from your message in #843999948717555735 a few seconds ago. We have already mentioned the @User so that they can see your message and help you as soon as possible! Want to unsubscribe from this thread? Right-click the thread in Discord (or use the ``...`` menu) and select "Leave Thread" to unsubscribe from future updates. Want to change the title? Use the ``/title`` command! We have solved your problem? Click the button below to archive it.
n
I tried
Copy code
supabaseClient
  .from("images")
  .select("*,snapshots:snapshot_id(*),categories:category_id(*)")
  .eq("snapshots.categories.name", categoryName)
  .limit(30)
Is this right?
.select("*, snapshots!inner( categories!inner ( name ) )")
s
What do the tables look like? is there a reference to the join tables inside of the
images
and
snapshot
tables?
n
@silentworks images belongs to snapshots, snapshots belong to categories
Inverse, categories have many snapshots, snapshots have many images
s
Sorry, I'm asking about table references. What does your table schemas look like?
n
I'm not sure how to pretty print it but its exactly as youd expect. images has
snapshot_id
and snapshots have
category_id
Is there a way to print it out of supabase?