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

Do not ignore order on distinct query #1570

Merged
merged 1 commit into from
Sep 4, 2017

Conversation

domenipavec
Copy link
Contributor

Make sure these boxes checked before submitting your pull request.

  • Do only one thing
  • No API-breaking changes
  • New code/logic commented & tested
  • Write good commit message, try to squash your commits into a single one
  • Run ./build.sh in gh-pages branch for document changes

For significant changes like big bug fixes, new features, please open an issue to make a agreement on an implementation design/plan first before starting it.

Thank you.

What did this pull request do?

I am trying to run query like this:
DB.Model(&Entry{}).Select("DISTINCT date_part('year', created_at) as year").Order("year desc")
And the years are not ordered. I am not sure what the reasoning behind ignoring order on distinct was, but I need the years ordered.

@jinzhu jinzhu merged commit c0ac6a7 into go-gorm:master Sep 4, 2017
iahmedov pushed a commit to housinganywhere/gorm that referenced this pull request Sep 3, 2018
blefevre pushed a commit to blefevre/gorm that referenced this pull request Feb 17, 2020
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.

2 participants