Home >Database >Mysql Tutorial >mysql数据库表里首行和末行的取得方法_MySQL

mysql数据库表里首行和末行的取得方法_MySQL

WBOY
WBOYOriginal
2016-06-01 13:04:271654browse

取得mysql数据库中表里的第一行:

SELECT mg.* FROM MaxGCC mg ORDER BY mg.JOBID ASC limit 0, 1;

取得mysql数据库中表里的最后一行:

SELECT mg.* FROM MaxGCC mg ORDER BY mg.JOBID desc limit 0, 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