SQLite--相关查询
发布时间:2020-12-12 20:06:17 所属栏目:百科 来源:网络整理
导读:1. 没有 top 关键字 在SQLite中改用limit来代替top用法,例如: select * from student order by id limit 1,3 该句的意思:从student表记录中,1开始的位置查询3条记录出来,并将结果按照id 列的升序排列. 2. 连接通配符使用 || 例如: select * from stude
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; (编辑:李大同) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |