Skip to content

Commit 8b2d486

Browse files
committed
Fix count operator.
1 parent abbf7f6 commit 8b2d486

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

internal/knowledge/query_expression_builder.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -165,6 +165,11 @@ func (sev *SQLExpressionVisitor) OnExitFunctionInvocation(name string, distinct
165165
if distinct {
166166
distinctStr = "DISTINCT "
167167
}
168+
169+
if name == "COUNT" && !distinct {
170+
sev.expression = "*"
171+
}
172+
168173
sev.functionInvocation = fmt.Sprintf("%s(%s%s)", name, distinctStr, sev.expression)
169174
sev.expression = ""
170175
return nil

0 commit comments

Comments
 (0)