This commit is contained in:
Looly 2022-10-23 13:33:20 +08:00
parent 8d5851a81f
commit eff36d7ecf

View File

@ -290,8 +290,8 @@ public class DialectRunner implements Serializable {
checkConn(conn);
String selectSql = sqlBuilder.build();
// 去除order by 子句
final int orderByIndex = StrUtil.indexOfIgnoreCase(selectSql, " order by");
// 去除最后的order by 子句
final int orderByIndex = StrUtil.lastIndexOfIgnoreCase(selectSql, " order by");
if (orderByIndex > 0) {
selectSql = StrUtil.subPre(selectSql, orderByIndex);
}