MySQL Forums
Forum List  »  InnoDB

Re: Fast Insert Where Not Exist
Posted by: Ferdie Palero
Date: December 01, 2016 11:00PM

Hi Peter,

Where I am wrong? it always inserting a row where there are existing records that no need to be inserted.

INSERT INTO exclusive (lname,fname,mname,address,city,state,zip)
SELECT a.lastname,a.firstname,a.mname,a.address,a.city,a.state,a.zip
FROM exclusive a
LEFT JOIN exclusive_temp b ON b.lname = a.lname
AND b.fname = a.fname
AND b.mname = a.mname
AND b.address = a.address
AND b.city = a.city
AND b.state = a.state
AND b.zip = a.zip;


Regards,
FPalero

Options: ReplyQuote


Subject
Views
Written By
Posted
1458
December 01, 2016 07:58PM
690
December 01, 2016 09:01PM
Re: Fast Insert Where Not Exist
878
December 01, 2016 11:00PM
698
December 02, 2016 12:08AM
743
December 02, 2016 12:24AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.