select * from table1 where key not in (select key from table2)

Ashish Kulkarni schrieb:
I have 2 tables which has similar structure, i want to
write a sql statement to compare the 2 tables and find
the missing keys from one
For example Table 1
Key Description
001 This is one
002 This is two

Table 2
Key Description
001 this is one

Now i want to write a query to find out, 002 is
missing in table 2, and may be a query to insert 002
into table2
Any ideas?



____________________________________________________________________________________Ready for the edge of your seat? Check out tonight's top picks on Yahoo! TV.

As an Amazon Associate we earn from qualifying purchases.

This thread ...


Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2022 by and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.