mirror of
https://github.com/alibaba/druid.git
synced 2023-03-04 19:17:16 +00:00
mysql count from子语句需要添加alias
This commit is contained in:
@@ -323,7 +323,9 @@ public class PagerUtils {
|
||||
SQLSelectItem countItem = createCountItem(dbType);
|
||||
countSelectQuery.getSelectList().add(countItem);
|
||||
|
||||
countSelectQuery.setFrom(new SQLSubqueryTableSource(select));
|
||||
SQLSubqueryTableSource fromSubquery = new SQLSubqueryTableSource(select);
|
||||
fromSubquery.setAlias("ALIAS_COUNT");
|
||||
countSelectQuery.setFrom(fromSubquery);
|
||||
|
||||
SQLSelect countSelect = new SQLSelect(countSelectQuery);
|
||||
SQLSelectStatement countStmt = new SQLSelectStatement(countSelect);
|
||||
|
||||
Reference in New Issue
Block a user