修复判空问题

This commit is contained in:
sswiki
2023-08-03 16:52:22 +08:00
parent a679130a93
commit a9cabd9ffe

View File

@@ -248,7 +248,9 @@ public class SqlParseUtil {
if (select.getOracleHierarchical() != null) {
countSql.append(select.getOracleHierarchical().toString());
}
countSql.append(PlainSelect.getFormatedList(select.getGroupBy().getGroupingSets(), "GROUP BY"));
if (select.getGroupBy() != null) {
countSql.append(PlainSelect.getFormatedList(select.getGroupBy().getGroupingSets(), "GROUP BY"));
}
if (select.getHaving() != null) {
countSql.append(" HAVING ").append(select.getHaving());
}