× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

I usually do something like this:

insert into table2 b
select * from table1 a
where not (exists
select * from table2 c
where c.key = a.key )

Pete Hall
pbhall@xxxxxxxxxxxxx
http://pbhall.us


Ashish Kulkarni wrote:
Hi
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?

Ashish

A$HI$H



____________________________________________________________________________________Ready for the edge of your seat?
Check out tonight's top picks on Yahoo! TV.
http://tv.yahoo.com/
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.7 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFGp9iKpcZsDl8OX6kRAgBfAJ9Zjp/oJFoXCjgJILAXNxRiR4gvewCfXmWs
16S1KM0hzoJQgKbRiwFTfYM=
=zgLj
-----END PGP SIGNATURE-----

As an Amazon Associate we earn from qualifying purchases.

This thread ...

Replies:

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

This mailing list archive is Copyright 1997-2024 by midrange.com 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.