I have a database with several tables, one being used to reference others :
Main table :
MAIN | table1 | table2 | table3
int | int | int
Each line of this table corresponds to a product, and contains the oid of a line in a daughter table
Then I have my daughter tables :
TABLE1 | name | adress | phone
| text | text | ...
My question is quite simple, even though as I just start using databases I can’t get to find the answer.
I would like to get the oid(s) of the line(s) of the main table which references the line of table1 for which name is equals to “bob”.
Something like :
SELECT * from main where table1.name = "bob"
If no complete solution, could you point me to some documentation ?
I think I miss vocabulary to find proper ressurces to do that.
Thanks by advance
You mean like
SELECT oid FROM MAIN WHERE table1 IN (SELECT oid FROM TABLE1 WHERE name = 'bob')?table1== foreign key fromMAINtoTABLE1.