CodingForums.com

CodingForums.com (http://www.codingforums.com/index.php)
-   MySQL (http://www.codingforums.com/forumdisplay.php?f=7)
-   -   Insert (if not exists) (http://www.codingforums.com/showthread.php?t=275728)

john6 10-08-2012 11:54 AM

Insert (if not exists)
 
Hi, could someone help me, how can I do:


Insert into table1 field1=x AND field2=y (if not already exist!)


:confused::confused::confused::confused::confused:

shyagrawal 10-08-2012 12:32 PM

Use Insert IGNORE
1.INSERT IGNORE INTO `tablename`SET `ensembl_transcript_id` = 'ENSORGT00000000001',`transcript_chrom_start` = 12345,`transcript_chrom_end` = 12678;


All times are GMT +1. The time now is 08:25 AM.

Powered by vBulletin®
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.