MYSQL SELECT DISTINCT query does not work in MYSQL 5.7.21

1

In the previous MySQL version of the hosting this sentence worked for me without problems: "SELECT DISTINCT Mes FROM recogida ORDER BY ID DESC"

Where the column ID is unique code for each entry in the table and Month is the month + year in text, example " October 2018 ". The results are used in a select option in HTLM to select the results of a Month column (which is month plus year) of the collection table. The result gave me the unique fields of Month sorted according to the ID in descending order. Now with MySQL 5.7.21 it has stopped working.

The error is:

  

3065 - Expression # 1 of ORDER BY clause is not in SELECT list, references column 'c2034314_water.recogida.ID' which is not in SELECT   list; this is incompatible with DISTINCT

Any suggestions?

    
asked by Multimedia 02.10.2018 в 16:34
source

0 answers