Add a table alias

This commit is contained in:
Lunny Xiao 2021-06-06 16:04:06 +08:00
parent af358193ca
commit 48ee47cdf6
1 changed files with 1 additions and 1 deletions

View File

@ -194,7 +194,7 @@ func (statement *Statement) GenCountSQL(beans ...interface{}) (string, []interfa
}
if statement.GroupByStr != "" {
sqlStr = fmt.Sprintf("SELECT %s FROM (%s)", selectSQL, sqlStr)
sqlStr = fmt.Sprintf("SELECT %s FROM (%s) sub", selectSQL, sqlStr)
}
return sqlStr, append(statement.joinArgs, condArgs...), nil