playground icon indicating copy to clipboard operation
playground copied to clipboard

COUNT does not work with multicolumn distinct

Open reality95 opened this issue 2 years ago • 0 comments

Explain your user case and expected results

I expect count to be equal to len(result), instead if you look at the debug logger, the distinct operation is dropped altogether for count if more than a column is provided. One single column works fine as in the documentation:

db.Model(&User{}).Distinct("name").Count(&count)

reality95 avatar Jan 17 '24 19:01 reality95