Oracle 与 SQL Server的简单常用的插入语句的区别
--Oracle的方式判断记录是否存在不存在则插入---
insert into a(a.user_id,a.user_name) select '2','李四' from dual where not exists
(select 1 from a where a.user_id='2')
--sql server的方式--
if not exists(select Test_TB.ID from Test_TB where ID='2')
insert into Test_TB values('2','李四',GETDATE())
相关推荐
gwn00 2020-05-12
liuyang000 2020-03-07
phpchandler 2012-01-08
lwwishes 2018-05-31
MikeG 2012-07-26
ALiDan 2019-04-18
MySQLl 2019-04-09
yushuir 2019-04-08
linshenshijianlu 2019-04-06
cjylean 2019-04-03