Go Back   CodingForums.com > :: Server side development > MySQL

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 10-08-2012, 11:54 AM   PM User | #1
john6
New Coder

 
Join Date: Sep 2012
Posts: 47
Thanks: 0
Thanked 0 Times in 0 Posts
john6 is an unknown quantity at this point
Question 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!)



Last edited by john6; 10-08-2012 at 12:18 PM..
john6 is offline   Reply With Quote
Old 10-08-2012, 12:32 PM   PM User | #2
shyagrawal
New Coder

 
Join Date: Sep 2012
Posts: 22
Thanks: 0
Thanked 6 Times in 6 Posts
shyagrawal is an unknown quantity at this point
Use Insert IGNORE
1.INSERT IGNORE INTO `tablename`SET `ensembl_transcript_id` = 'ENSORGT00000000001',`transcript_chrom_start` = 12345,`transcript_chrom_end` = 12678;
shyagrawal is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 10:46 PM.


Advertisement
Log in to turn off these ads.