Home >Backend Development >PHP Tutorial >php怎么满足某一种条件,只取最新的一条数据

php怎么满足某一种条件,只取最新的一条数据

WBOY
WBOYOriginal
2016-06-13 12:15:311471browse

php如何满足某一种条件,只取最新的一条数据

SELECT * FROM pc_record WHERE name LIKE '小明' LIMIT 1



这种写法是随机取一条数据,我想取最新的一条,该怎么写

求大神指教
------解决思路----------------------
order by id desc
或者发布时间 desc

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