Skip to content

ORDER BY clause is not in SELECT list #683

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

Closed
KirbyFox opened this issue Oct 22, 2017 · 5 comments
Closed

ORDER BY clause is not in SELECT list #683

KirbyFox opened this issue Oct 22, 2017 · 5 comments
Labels

Comments

@KirbyFox
Copy link

Converted this to use MySQL and it throws the following exception:

SQLSTATE[HY000]: General error: 3065 Expression #1 of ORDER BY clause is not in SELECT list, references column 'dctrn_result.publishedAt_5' which is not in SELECT list; this is incompatible with DISTINCT").

@javiereguiluz
Copy link
Member

We received the exact same issue report in https://github.com/javiereguiluz/EasyAdminBundle/issues/1871. Is this really a misuse on our side ... or a bug in the pagination bundle?

@stof
Copy link
Member

stof commented Oct 23, 2017

This should be reported to the Doctrine ORM project, as it is the one implementing the ORM pagination.
And please include the DQL query being paginated in the issue report, as well as the mysql configuration regarding strict mode and related settings (MySQL changes its behavior a lot based on these options regarding what is valid in SQL).

@javiereguiluz
Copy link
Member

Let's close this old issue as suggested by Christophe. Thanks.

@mario6097
Copy link

Hi

I am trying to learn Symfony 4.0. Install of symfony-demo returns error as above

SQLSTATE[HY000]: General error: 3065 Expression #1 of ORDER BY clause is not in SELECT list, references column 'dctrn_result.publishedAt_5' which is not in SELECT list; this is incompatible with DISTINCT").

If I cut away the {% for post in posts %} portion within app/Resources/views/blog/index.html.twig (line 6), demo runs fine (but of course this is not a fix).

I do not get how you fixed it
your hints are welcome, thanks, cheers
m.

@jywarren
Copy link

Linking together some threads here - i believe it has to do with mysql version (we were able to bypass by using 5.7) and/or strict mode: publiclab/plots2#8145

Thanks!

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

5 participants