pagehelper / Mybatis-PageHelper

Mybatis通用分页插件
https://mybatis.io
MIT License
12.22k stars 3.13k forks source link

Sql Server 2012 order by #115

Closed arcaphalia closed 6 years ago

arcaphalia commented 7 years ago

当sql语句比较复杂时,select count(0)会把order by 包进去,导致报错 除非另外还指定了 TOP、OFFSET 或 FOR XML,否则,ORDER BY 子句在视图、内联函数、派生表、子查询和公用表表达式中无效。比如用select name = case when id=1 uu....

abel533 commented 7 years ago

复杂SQL没法自动去排序,用5.0.4能自动调手写的count查询。 详细看:https://github.com/pagehelper/Mybatis-PageHelper/blob/master/wikis/zh/Changelog.md