|
Posted by Stefan Rybacki on 11/23/05 18:09
Chris Thompson wrote:
> Hi All,
>
> I'm trying to work out how to change the following mysql statement which
> inserts rows from one table into another. I want to ensure that it does
> *not* insert rows if an exact match of the row already exists on the table.
>
> I've tried to use WHILE NOT EXISTS, but I can't seem to get the syntax
> right... can anyone help please?
>
>
> INSERT INTO Contacts SELECT DISTINCT null as
> ID,CustName,Company,TelNo,Email,Mobile,Web,Address FROM ConTemp
>
> (It works as is, but causes duplicate rows).
Create an unique index over
CustName,Company,TelNo,Email,Mobile,Web,Address
Regards
Stefan
>
> Thanks in advance of any assistance...,
>
> Chris.
>
>
>
Navigation:
[Reply to this message]
|