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

General error: 3065 Expression #1 of ORDER BY #77

Closed
hrohwer opened this issue Nov 4, 2018 · 3 comments
Closed

General error: 3065 Expression #1 of ORDER BY #77

hrohwer opened this issue Nov 4, 2018 · 3 comments

Comments

@hrohwer
Copy link

hrohwer commented Nov 4, 2018

Hi Guys,

I get the following error when logging a second user in.

I've traced it down to "->orderBy('created_at')" line 87 in WebsiteNotification.php

By removing it I can continue.

"SQLSTATE[HY000]: General error: 3065 Expression #1 of ORDER BY clause is not in SELECT list, references column 'freescout.threads.created_at' which is not in SELECT list; this is incompatible with DISTINCT (SQL: select distinct id, conversation_id, body from threads where conversation_id in (2) and type in (1, 2, 3) order by created_at asc) (View: C:\laragon\www\FREESCOUT\freescout\resources\views\layouts\app.blade.php) (View: C:\laragon\www\FREESCOUT\freescout\resources\views\layouts\app.blade.php) ◀"

@freescout-helpdesk
Copy link
Contributor

freescout-helpdesk commented Nov 4, 2018

Hi. What version of MySQL/MariaDB are you using?

Try to change line 84 in WebsiteNotification.php to:

->select(['id', 'conversation_id', 'body', 'created_at'])

and line 87 in BroadcastNotification.php:

->select(['body', 'created_at'])

@hrohwer
Copy link
Author

hrohwer commented Nov 4, 2018

MySQL 5.7.19
Changed those lines and seems to work perfectly :)

By the way, great work on this project 👍

@freescout-helpdesk
Copy link
Contributor

Great. Thanks.

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

No branches or pull requests

2 participants