欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页  >  数据库

mysql中如何查询表的第一条和最后一条记录

程序员文章站 2022-05-20 09:58:05
...

无详细内容 无 SELECT createdtime FROM `Z_2015-09-15` WHERE deviceid='460040271516782' limit 1;SELECT createdtime FROM `Z_2015-09-15` WHERE deviceid='460040271516782' order by id DESC limit 1;

SELECT createdtime FROM `Z_2015-09-15` WHERE deviceid='460040271516782' limit 1;

SELECT createdtime FROM `Z_2015-09-15` WHERE deviceid='460040271516782' order by id DESC limit 1;