Querying with foreign key

Posted by theactiveactor on Stack Overflow See other posts from Stack Overflow or by theactiveactor
Published on 2010-05-30T00:52:09Z Indexed on 2010/05/30 1:02 UTC
Read the original article Hit count: 258

Filed under:
|

Say I have 2 tables whose structures are as follows:

tableA

id | A1 | A2

tableB

id | tableA_id (foreign key) | B1

Entries in A have a one-to-many relationship with entries in B. What kind of query operation would I need to achieve "something like this: select all objects from table B where A1="foo""? Basically, apply a query on tableA and from those result, find corresponding dependent objects in tableB

© Stack Overflow or respective owner

Related posts about sql

Related posts about sqlite