mysql - "if not exists" SQL Statement Giving Error -


this question has answer here:

i have following sql query running , giving me error 1064, syntax error.

if not exists (select * locations street_address = 'test')  begin     insert locations (street_address) values ('test')  end; 

can please me out? seems simple yet not run. thanks.

also, i'm running mysql version 5.6.11

also can try this

insert locations (street_address) select 'test' dual not exists (    select * locations street_address = 'test' ) limit 1; 

Comments

Popular posts from this blog

Android layout hidden on keyboard show -

google app engine - 403 Forbidden POST - Flask WTForms -

c - Why would PK11_GenerateRandom() return an error -8023? -