Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@EndlessIdea
Copy link
Contributor

We find using xxx.Query().Unique(true).Select("field1").Strings(ctx) doesn't return the expected distinct values we want.
For example, there are two records:

id, username, city
1, Gary, Singapore
2, Jack, Singapore

The value of xxx.Query().Unique(true).Select("city").Strings(ctx) is [Singapore, Singapore], but [Singapore] is the expected return value.

@orijbot
Copy link

orijbot commented Sep 18, 2021

@a8m
Copy link
Member

a8m commented Sep 21, 2021

Thanks for your contribution @EndlessIdea 🙏

This looks good. I'll wait for the CI to pass and review this.

a8m added a commit that referenced this pull request Sep 21, 2021
Unique Field Selection - Merge #1959
@a8m a8m merged commit fe7375f into ent:master Sep 21, 2021
@a8m
Copy link
Member

a8m commented Sep 21, 2021

Thanks for your contribution @EndlessIdea and @Lining-Grab.

@all-contributors please add @EndlessIdea and @Lining-Grab for code.

@allcontributors
Copy link
Contributor

@a8m

I've put up a pull request to add @EndlessIdea! 🎉

@EndlessIdea
Copy link
Contributor Author

Thank you @a8m !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants