fix distinct & count bug
This commit is contained in:
parent
bc97322264
commit
0d9762712b
|
@ -1167,7 +1167,7 @@ func (statement *Statement) genSumSQL(bean interface{}, columns ...string) (stri
|
||||||
|
|
||||||
func (statement *Statement) genSelectSQL(columnStr, condSQL string) (a string) {
|
func (statement *Statement) genSelectSQL(columnStr, condSQL string) (a string) {
|
||||||
var distinct string
|
var distinct string
|
||||||
if statement.IsDistinct {
|
if statement.IsDistinct && !strings.HasPrefix(columnStr, "count") {
|
||||||
distinct = "DISTINCT "
|
distinct = "DISTINCT "
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue