mysql常用查询

查询全部的记录:        select * from test_limit ;
查第一条记录:          select * from test_limit limit 1;
查前面两条记录:        select * from test_limit limit 0,2;
查第二和第三条记录:     select * from test_limit limit 1,2;
查最后一条记录:       select * from test_limit order by id DESC limit 1;

按照log_time字段排序:
select * from log_science order by log_time;

限制显示输出条数
select * from log_science order by log_time desc limit 10;

 

posted @ 2022-09-16 17:09  chenjianwen  阅读(22)  评论(0编辑  收藏  举报