sqlserver版:if exists(select id from waynejiang where id=1)
update waynejiang set name='XX' where id=1
else insert into waynejiang(id,name) values (1,'XX')
oracle版:merge into waynejiang
using (select 1 as id,'XX' as name from dual) a
on (waynejiang.id=a.id)
when matched then update set name='XX' where id = 1
when not matched then insert (id,name) values(1,'XX');
mysql版:insert into waynejiang(id,name) values (1,'XX')
on duplicate key update name='XX';
update waynejiang set name='XX' where id=1
else insert into waynejiang(id,name) values (1,'XX')
oracle版:merge into waynejiang
using (select 1 as id,'XX' as name from dual) a
on (waynejiang.id=a.id)
when matched then update set name='XX' where id = 1
when not matched then insert (id,name) values(1,'XX');
mysql版:insert into waynejiang(id,name) values (1,'XX')
on duplicate key update name='XX';