Skip to content
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

Count does not work with multiple Distinct arguments #6798

Open
reality95 opened this issue Jan 17, 2024 · 0 comments
Open

Count does not work with multiple Distinct arguments #6798

reality95 opened this issue Jan 17, 2024 · 0 comments
Assignees
Labels
type:with reproduction steps with reproduction steps

Comments

@reality95
Copy link

GORM Playground Link

go-gorm/playground#683

Description

I'm using postgres as reference and it looks like gorm does not format properly count if Distinct is called with more than one argument before it. I've tried manually inserting the raw sql with count(distinct(arg1, arg2, ...)) and it seems to work fine the database. gorm defaults to count(*) instead and uses distinct only in the Find query. I expect both of them to have distinct.

Related issue but not quite the same: #6790

@github-actions github-actions bot added the type:with reproduction steps with reproduction steps label Jan 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type:with reproduction steps with reproduction steps
Projects
None yet
Development

No branches or pull requests

2 participants