python sqlite3查询表记录


1.查询数据库log_info表最后10条记录。

  desc - 指"降序"

  解决的方法是:按照ID 逆序排列,选取前10个

  select * from 'log_info' order by id desc limit 10;

2.查询数据库log_info表最前10条记录。

  asc 指升序

  解决的方法是:按照ID升序排列,选取前10个

  select * from 'log_info'  order by id asc limit 10;

3.查询数据库log_info表最后0-10(10条)记录。

  desc - 指"降序"

  select * from 'log_info'  order by id desc limit 0,10;

4.查询数据库log_info表最后10-20(10条)记录。

  desc - 指"降序"

  select * from 'log_info'  order by id desc limit 10,10;

5.查询数据库log_info表最前0-10(10条)记录。

  asc 指"升序"

  select * from 'log_info'  order by id asc limit 0,10;

6.查询数据库log_info表最前10-20(10条)记录

  asc 指"升序"

  select * from 'log_info'  order by id asc limit 10,10;

 

 

 


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM