I have two tables say Table1 and Table2. Both the tables have a number of columns, but the ones I am looking at are called ID, PhoneID, Description. Both the tables have these common columns. Here is what I am trying to do. Suppose TABLE1 has this data.
--------Table1---------
ID PhoneID Description
5 1 Nokia
7 2 Motorola
10 3 Samsung
Now if Table2 has following info--
-------Table2-----------
ID PhoneID Description
3 3 Samsung
Now I want my query to return ONLY those entries from table1 that do not exsist in Table2. So Nokia and Motorola should be returned in the above example. Table2 could have multiple entries of the same name. So it could have PhoneID 3 Samsung twice.
I wrote something like this but it doesnt seem to work.
Any help would be appreciated.
--------Table1---------
ID PhoneID Description
5 1 Nokia
7 2 Motorola
10 3 Samsung
Now if Table2 has following info--
-------Table2-----------
ID PhoneID Description
3 3 Samsung
Now I want my query to return ONLY those entries from table1 that do not exsist in Table2. So Nokia and Motorola should be returned in the above example. Table2 could have multiple entries of the same name. So it could have PhoneID 3 Samsung twice.
I wrote something like this but it doesnt seem to work.
Code:
SELECT t1.*
FROM Table1 t1,Table2 t2
WHERE t1.EventID <> t2.EventID
Any help would be appreciated.