sqlite不存在记录则插入数据
问题:如下图在Sqlite数据库中存在一张Student表,现需要向表中插入数据,如果不存在同名记录则插入,否则不进行插入操作。解答:利用not exists语句,如下:insert into [Student]([Name], [Age]) select '周俊豪', 21 where not exists (select * from [Student] where [Name]='周俊豪')...
原创
2018-03-01 15:47:01 ·
6944 阅读 ·
1 评论