Home » RDBMS Server » Server Administration » Select unique rows from one table to other
Select unique rows from one table to other [message #371983] Sat, 30 December 2000 01:57 Go to next message
sri
Messages: 154
Registered: February 2000
Senior Member
hi,
I want to select and insert from table A to Table B where in Table A contains new set of records and Want to move only the records which are not there in Table B.

Please suggest me the sql for this.

Thanks in advance & Happy New Year to all

Sri
Re: Select unique rows from one table to other [message #371989 is a reply to message #371983] Mon, 01 January 2001 23:53 Go to previous message
Vince
Messages: 11
Registered: December 2000
Junior Member
Hi Sri,

Give this a try !!!

Insert Into Table_B As
Select <Column_Names>
FRom Table_A
Where PK_Name NOT Exists IN ( Select PK_NAME
from Table_B Where Table_A.PK_Name = Table_B.PK_NAME );

Regards

Vince.
Previous Topic: How to describe all the tables from tab?
Next Topic: Info Related To DML to XML
Goto Forum:
  


Current Time: Fri May 17 17:17:30 CDT 2024