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

SQL query problem

Status
Not open for further replies.

MikeLee

Programmer
Aug 7, 2002
10
HK
I have some problem about my query,
I wonder how can i find result that only exist on table 1, but not table 2
table 1 - {card_no, other_data}
table 2 - {card_no, other_data2}

let say table 1 have record {1, data1}, {2, data2}, {3,data3}

table 2 have record {1, dataa}, {3, datac} ,{4, datad}
i would like to have record {2, data2} only

i try this query but not work?
SELECT *
FROM table1 as r
WHERE r.card_no NOT LIKE (SELECT s.card_no
FROM table2 as s
WHERE s.card_no = r.card_no)";
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top