Join 1M+ other developers and:
- Get help and share knowledge in Q&A
- Subscribe to topics of interest
- Get courses & tools that help you grow as a developer or small business owner
WordPress database error: [Expression #1 of ORDER BY clause is not in SELECT list...
We’re using DO managed database for two of our Wordpress sites, one of them shows the following error with debug=true in wp-config.php
WordPress database error: [Expression #1 of ORDER BY clause is not in SELECT list, references column ‘wordpress-programs.wpposts.postdate’ which is not in SELECT list; this is incompatible with DISTINCT] SELECT DISTINCT YEAR( postdate ) AS year, MONTH( postdate ) AS month FROM wpposts WHERE posttype = 'attachment’ ORDER BY post_date DESC
Wordpress 5.2.3. PHP 7.3.9-1+ubuntu18.04.1+deb.sury.org+1, MySQL 8.0.16 - Linux
The other site is just fine, see config below and the content is identical i.e we have similar posts on both
Wordpress 5.2.3 PHP 7.2.19-0ubuntu0.18.04.2, MySQL 8.0.16 - Linux
We’ve tried the fixes for Disable ONLYFULLGROUP_BY from the following link but didn’t help. Can you please review and help?
These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.×