5.1.11 升级到 5.3.2 后,union 语句中的 order by 会报错

作者: lcl-yn创建于 2025年6月4日更新于 2025年6月5日

In the original version 5.1.11, the order by concatenation is normal, but in 5.3.2, the order by concatenation is placed in the inner layer, resulting in an error: **SQL error [1033] [S0001]: Unless TOP, OFFSET, or FOR XML is also specified, the ORDER BY clause is invalid in views, inline functions, derived tables, subqueries, and common table expressions.** The following is the restored SQL: In the original version 5.1.11, the order by for the following SQL is normal:

内容来源: pagehelper-org/Mybatis-PageHelper