Home > Database > Mysql Tutorial > MYSQL的降序排列_MySQL

MYSQL的降序排列_MySQL

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
Release: 2016-06-01 13:36:27
Original
2290 people have browsed it

bitsCN.com


MYSQL的降序排列

 

今天查询时需要用到降序排列,老是出错,仔细检查SQL语法也没问题,

后来才知道,原来order by要放在limit的前面。或者说limit要放在最后。

[sql] 

String sql = "select * from s_dayreport " +  

                    "where userId = "+userId+" " +  

                            "order by taskDate desc " +  

                            "limit "+firstResult+","+maxResults+" ";  

 

bitsCN.com
Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template