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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

query

Status
Not open for further replies.

raji96

Programmer
Aug 7, 2001
64
US
How can i redo the below query without sub query.



Select tab1.first from
table1 tab1
where tab1.first not in
(select tab2.first from table2 tab2)

Basically i want to select a particular field from table one where the is no match in the table 2.

--thanks
 
I think the "minus" operator is just what you need:

select first from tab1
minus
select first from tab2;
 
or.....

SELECT distinct tab1.first
FROM table1 tab1, table2 tab2
WHERE tab1.first = tab2.first(+)
AND tab2.first IS NULL
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top