mysql - Inserting multiple rows with SQL where a record does not exist -
i want insert multiple rows of data mysql database, when order_id field unique. current query have, doesn't work. lets record order_id of 2 in table:
insert conversion (user_id,url_id,order_id,sale,commission,transaction_date,process_date) values (1,1,1,'32',0.3995,'2010-11-15 12:15:18','2010-11-15 12:15:18'), (3,6,2,'*not-available*',0.001975,'2010-11-15 12:15:18','2010-11-15 12:15:18') (order_id <> 3);
any appreciated.
tom
solved using replace.
example:
replace conversion (user_id,url_id,order_id,sale,commission,transaction_date,process_date) values (1,1,3,'32',0.3995,'2010-11-15 12:50:31','2010-11-15 12:50:31'),(1,2,2,'*not-available*',0.001975,'2010-11-15 12:50:31','2010-11-15 12:50:31');
url: http://dev.mysql.com/doc/refman/5.0/en/replace.html
thanks all.
Comments
Post a Comment