troubleshooting Question

SQL using XREF table

Avatar of deleyd
deleydFlag for United States of America asked on
SQLOracle Database
1 Comment1 Solution11 ViewsLast Modified:
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)
and the XREF table is something like:
Name     Id
----     --
David    1
Susan    2
Charlene 3
and MYTABLE is something like:
Id   Stuff
--   -----
1     xxx
1     yyy
1     zzz
2     aaa
2     bbb
3     ccc
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.)
Join our community to see this answer!
Unlock 1 Answer and 1 Comment.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 1 Comment.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros