
解答:利用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 利用
本文系统来源:https://www.cnblogs.com/liujian619/p/sqlite-insert-into-where-not-exists.html
【说明】:本文章由站长整理发布,文章内容不代表本站观点,如文中有侵权行为,请与本站客服联系(QQ:254677821)!