SQLite--相关查询

来源:互联网 发布:剑三 捏脸数据 编辑:程序博客网 时间:2024/05/23 12:48

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;

0 0
原创粉丝点击