Home >Database >Mysql Tutorial >mysql中如何查询表的第一条和最后一条记录

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

WBOY
WBOYOriginal
2016-06-07 14:58:112005browse

无详细内容 无 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;
Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn