Unable to prepare MySQL statement (check your syntax) - Expression #1 of ORDER BY clause is not in SELECT list, references column 'ecatt_prevencionfraude.p.dia' which is not in SELECT list; this is incompatible with DISTINCT