I'm rusty on my SQL. I need a statement which is essentially:
SELECT * FROM MYTABLE WHERE ID = (given 'name', find row in XREF table matching name, get corresponding id from that row)
Open in new window
and the XREF table is something like:
Name Id
---- --
David 1
Susan 2
Charlene 3
Open in new window
and MYTABLE is something like:
Id Stuff
-- -----
1 xxx
1 yyy
1 zzz
2 aaa
2 bbb
3 ccc
Open in new window
I'm given a name, such as 'David', and I want to select the rows in MYTABLE with Id=1.
(This is an Oracle database, if that makes any difference.)