-
-
Notifications
You must be signed in to change notification settings - Fork 3.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
distinct did not take effect when shared with count #5821
Comments
@ssmmtt Can you explain why did you close this? Where you able to fix the issue? How? |
I don't know about MySQL, but in PostgreSQL it's perfectly valid to do: SELECT COUNT(DISTINCT(name, age)) FROM users GORM's docs for
But the behavior of Like you mentioned above, GORM generates incorrect SQL for this: SELECT COUNT(*) FROM users I think this issue shouldn't be closed. |
The error "Operand should contain 1 column(s)" indicates that the operand in the SQL query should contain only 1 column, but you have provided multiple columns instead.
|
Your Question
distinct did not take effect when shared with count, mysqldb.
It does not take effect.
The actual sql statement of is "SELECT COUNT(*) FROM
users
"The text was updated successfully, but these errors were encountered: