mssql和sqlite关于if not exists 的写法

作者:freethy 发布于:2014-3-31 8:52 Monday

mssql语法:

if not exists (SELECT 1 FROM [t_Table] where [fName] = '张三')
insert into [t_Table] ([fName]) values ('张三'); 
sqlite语法:

insert into [t_Table] ([fName]) select '张三'
where not exists (SELECT 1 FROM [t_Table] where [fName] = '张三'); 

评论(0) 引用(0) 浏览(1645)

Powered by emlog 苏ICP备11068260号-3