输入banner图图片脚本导航/分类

sqlite不存在记录则插入数据

技术分享图片

  解答:利用not exists语句,如下:

insert into [Student]([Name], [Age]) select ‘周俊豪‘, 21 
where not exists (select * from [Student] where [Name]=‘周俊豪‘)??

  执行该语句,第一遍执行之后会将 周俊豪 这条数据插入,再次执行则不再进行插入操作了。

 

  文章同步更新:http://www.motyer.cn/Files/BlogDetails/sqlite-insert-into-where-not-exists.html

sqlite不存在记录则插入数据

标签:分享   from   div   name   target   student   数据库   margin   利用