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

Distinct constraint #125

Closed
deiu opened this issue Dec 2, 2020 · 2 comments
Closed

Distinct constraint #125

deiu opened this issue Dec 2, 2020 · 2 comments
Assignees
Labels

Comments

@deiu
Copy link

deiu commented Dec 2, 2020

Hello,

Is there a way to specific a "Distinct" constraint when building a query? Basically something like SQL's SELECT DISTINCT.

Thanks!

@timshannon timshannon self-assigned this Dec 2, 2020
@timshannon
Copy link
Owner

Aggregate queries are what you're looking for: https://github.com/timshannon/bolthold#aggregate-queries

Just like in SQL, running a distinct is the same as running a group by (for the most part.

You can find more examples in the tests: https://github.com/timshannon/bolthold/blob/master/aggregate_test.go

@deiu
Copy link
Author

deiu commented Dec 3, 2020

Thanks for the quick reply, I'll give it a try!

@deiu deiu closed this as completed Dec 3, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants