Inserting unique records from a table to another
Can anyone please help me with this? I want to insert records to a table coming from another table. The condition is that, insert should only insert records from the source table with ID not in the target table. My code is something like this:
counterparty <> '' AND
not exists (Select counterparty_id from targetTable)
There are records in the source table with the same counterparty. And these records with the same counterparty should be copied only once or if they are not yet in the target table.
Thanks in advance!