Home  >  Article  >  Backend Development  >  mysql语句,根据插入时间和修改的时间差排序

mysql语句,根据插入时间和修改的时间差排序

WBOY
WBOYOriginal
2016-06-23 13:18:511389browse

mysql语句,根据插入时间和修改的时间差排序。插入时间insertTime,修改时间updateTime这两个字段的时间差从大到小排序


回复讨论(解决方案)

select   (updateTime-insertTime) as times from xxx order by times desc  具体的 请根据你需求来做

select  (修改时间 - 创建时间) as t from tb  order by t  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