Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

where two fields in subquery???

Status
Not open for further replies.

m0nkey

MIS
Mar 20, 2003
31
0
0
hi...
i was hoping for a little help with a quey that is presumably an easy write but it is missing me right now...
here is the query i would like to run but it is incorrect obviuosly:

select distinct npa_nxx_id, zipcode, city, state
from npanxx
join zipusa on zipusa.zipcode = npanxx.zipcode
where npa_nxx_id, zipcode in
(select npanxx,zipcode from npa_zip)

My problem is that i need to qualify on the two of the columns in the subquery to make this work...

any ideas...
thanks in advance...
mark
 
Code:
select distinct npa_nxx_id, zipcode, city, state 
from npanxx 
join zipusa on zipusa.zipcode = npanxx.zipcode
inner join npa_zip z on npanxx.npa_nxx_id = z.npanxx AND
npanxx.zipcode = z.zipcode

would this work?
 
That worked perfect...i knew it was something simple, but i was brainfarting...thanks for the help!!!!!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top