Re: Exclusive Query
From: Tarang Deshpande (TarangDeshpande_at_discussions.microsoft.com)
Date: 09/10/04
- Previous message: mariela_montero_at_ncsu.edu: "Server identifier"
- In reply to: Vishal Parkar: "Re: Exclusive Query"
- Next in thread: Vishal Parkar: "Re: Exclusive Query"
- Reply: Vishal Parkar: "Re: Exclusive Query"
- Messages sorted by: [ date ] [ thread ]
Date: Fri, 10 Sep 2004 10:13:03 -0700
That seems to work well. Now I'd like to add the result back into the second
table so that table2 ends up like table1.
I tried:
INSERT INTO table2 ( id )
SELECT table1.id FROM table1 WHERE NOT EXISTS
( SELECT table2.id FROM table2 WHERE table1.id = table2.id )
but that doesn't seem to work.
"Vishal Parkar" wrote:
> Try:
>
> select id from table1 a
> where not exists
> (select * from table2 b
> where a.id = b.id)
>
> --
> Vishal Parkar
> vgparkar@yahoo.co.in | vgparkar@hotmail.com
>
>
>
- Previous message: mariela_montero_at_ncsu.edu: "Server identifier"
- In reply to: Vishal Parkar: "Re: Exclusive Query"
- Next in thread: Vishal Parkar: "Re: Exclusive Query"
- Reply: Vishal Parkar: "Re: Exclusive Query"
- Messages sorted by: [ date ] [ thread ]