Ask Your Question
0

How can one search for related fields in reverse order in Supabase?

asked 2023-05-10 22:03:42 +0000

nofretete gravatar image

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
0

answered 2023-05-10 22:11:01 +0000

bukephalos gravatar image

To search for related fields in reverse order in Supabase, you can use a JOIN statement with the ON condition in the opposite direction of the typical join condition. For example:

* FROM table_a JOIN table_b ON table_a.id = table_b.a_id

This query will return all data from both Table A and Table B that have a matching ID in Table A and a matching a_id in Table B.

To search in reverse order, you would use:

* FROM table_a JOIN table_b ON table_a.id = table_b.a_id

This query will return all data from both Table A and Table B that have a matching a_id in Table B and a matching ID in Table A.

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account. This space is reserved only for answers. If you would like to engage in a discussion, please instead post a comment under the question or an answer that you would like to discuss

Add Answer


Question Tools

Stats

Asked: 2023-05-10 22:03:42 +0000

Seen: 11 times

Last updated: May 10 '23