SQLite--相关查询

SQLite--相关查询,第1张

概述1. 没有 top 关键字     在SQLite中改用limit来代替top用法,例如: select * from student order by id limit 1,3  该句的意思:从student表记录中,1开始的位置查询3条记录出来,并将结果按照id    列的升序排列. 2. 连接通配符使用 ||    例如: select * from student where name l

1. 没有 top 关键字

在sqlite中改用limit来代替top用法,例如: select * from student order by ID limit 1,3 该句的意思:从student表记录中,1开始的位置查询3条记录出来,并将结果按照ID

列的升序排列.

2. 连接通配符使用 ||

例如: select * from student where name like '%e' || 's%'

3. exists的使用

例如: select * from student where exists(select ID from school where stuID=1) and stuID = 1

4. 返回新插入数据的自增ID

insert into student(stuname,stuage) values("aa",12);

select last_insert_rowID() from student limit 0,1;

总结

以上是内存溢出为你收集整理的SQLite--相关查询全部内容,希望文章能够帮你解决SQLite--相关查询所遇到的程序开发问题。

如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。

欢迎分享,转载请注明来源:内存溢出

原文地址: http://outofmemory.cn/sjk/1172857.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-06-02
下一篇 2022-06-02

发表评论

登录后才能评论

评论列表(0条)

保存