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!

Problem checking values 1

Status
Not open for further replies.

morfasie

IS-IT--Management
Mar 28, 2004
85
ZA
Hi

I have a table test
Number
|1 |
|2 |
|3 |

and a table test2
Number
|1 |
|2 |

I want a query where the returning result is the 3, because it isn't in both tables.
 
Something like this ?
SELECT * FROM test
WHERE Number NOT IN (SELECT Number FROM test2)
Or this ?
SELECT A.* FROM test A LEFT JOIN test2 B ON A.Number = B.Number
WHERE B.Number IS NULL

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top