[SOLVED] java.sql.SQLException: Expression #1 of ORDER BY clause is not in SELECT list, references column ” which is not in SELECT list; this is incompatible with DISTINCT

java.sql.SQLException: Expression #1 of ORDER BY clause is not in SELECT list, references column ” which is not in SELECT list; this is incompatible with DISTINCT

This happens in MySQL 5.7, it is a new additional constraint added by default. It is the mode: ONLY_FULL_GROUP_BY

The solution is to disable it in my.cnf :

 

 

 

 

 

Leave a Reply

Your email address will not be published. Required fields are marked *