Dec 12, 2001 #1 raji96 Programmer Joined Aug 7, 2001 Messages 64 Location 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
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
Dec 12, 2001 #2 karluk MIS Joined Nov 29, 1999 Messages 2,485 Location US I think the "minus" operator is just what you need: select first from tab1 minus select first from tab2; Upvote 0 Downvote
I think the "minus" operator is just what you need: select first from tab1 minus select first from tab2;
Dec 13, 2001 #3 lewisp Programmer Joined Aug 5, 2001 Messages 1,238 Location GB or..... SELECT distinct tab1.first FROM table1 tab1, table2 tab2 WHERE tab1.first = tab2.first(+) AND tab2.first IS NULL Upvote 0 Downvote
or..... SELECT distinct tab1.first FROM table1 tab1, table2 tab2 WHERE tab1.first = tab2.first(+) AND tab2.first IS NULL