Avatar of deleyd
deleyd
Flag for United States of America asked on

SQL using XREF table

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.)
SQLOracle Database

Avatar of undefined
Last Comment
slightwv (䄆 Netminder)

8/22/2022 - Mon
ASKER CERTIFIED SOLUTION
slightwv (䄆 Netminder)

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
I started with Experts Exchange in 2004 and it's been a mainstay of my professional computing life since. It helped me launch a career as a programmer / Oracle data analyst
William Peck