SQLite中中实现 if not exist 类似功能

来源:互联网 发布:js 数组添加 编辑:程序博客网 时间:2024/05/19 17:04

需要实现:

if not exists(select * from ErrorConfig where Type='RetryWaitSeconds')begin     insert into ErrorConfig(Type,Value1)     values('RetryWaitSeconds','3')end

只能用:

insert into ErrorConfig(Type,Value1)select 'RetryWaitSeconds','3'where not exists(select * from ErrorConfig where Type='RetryWaitSeconds')

因为 SQLite 中不支持SP

0 0
原创粉丝点击