fix group by duplicate column on mysql
This commit is contained in:
parent
d47f35b260
commit
88182564a9
|
@ -161,7 +161,12 @@ func (statement *Statement) GenCountSQL(beans ...interface{}) (string, []interfa
|
||||||
|
|
||||||
var subQuerySelect string
|
var subQuerySelect string
|
||||||
if statement.GroupByStr != "" {
|
if statement.GroupByStr != "" {
|
||||||
subQuerySelect = statement.GroupByStr
|
i := strings.Index(statement.GroupByStr, ",")
|
||||||
|
if i > -1 {
|
||||||
|
subQuerySelect = statement.GroupByStr[:i]
|
||||||
|
} else {
|
||||||
|
subQuerySelect = statement.GroupByStr
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
subQuerySelect = selectSQL
|
subQuerySelect = selectSQL
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue