Salve a tutti , ho questa query :
codice:
SELECT `ingresso_temp`.`id_macchina`,
`macchina`.`id_clienti`,
`clienti`.`nome` as `nome_clienti`,
`macchina`.`seriale`,
count(ingresso_temp.id_macchina) as numero_macchine
FROM `ingresso_temp`
JOIN `macchina` ON `macchina`.`id`=`ingresso_temp`.`id_macchina`
JOIN `clienti` ON `macchina`.`id_clienti`=`clienti`.`id`
WHERE `ingresso_temp`.`macchina_presente` = 1
AND `ingresso_temp`.`deleted_at` IS NULL
GROUP BY `macchina`.`id_clienti`
e questo errore :
codice:
Errore nella query (1055): Expression #1 of SELECT list is not in GROUP BY clause and contains nonaggregated column 'wms_capalle_locale.ingresso_temp.id_macchina' which is not functionally dependent on columns in GROUP BY clause; this is incompatible with sql_mode=only_full_group_by
se aggiungo nel group by `ingresso_temp`.`id_macchina` l'errore sparisce ma non è il risultato che mi aspetto perchè io voglio prendere tutte le macchine che sono in ingresso raggrupparle per cliente e contare quante sono