Group_concat in colonne
Query per esprimere in forma incolonnata il group concat
1select max(case when posizione='Amministrativo' 2 then cognome else '' end) as Amministativi, 3 max(case when posizione='Capo Reparto' 4 then cognome else '' end) as Capi_Reparto, 5 max(case when posizione='Commesso' 6 then cognome else '' end) as Commessi, 7 max(case when posizione='Magazziniere' 8 then cognome else '' end) as Magazzinieri 9from ( 10 select e.posizione, 11 e.cognome, 12 (select count(*) from impiegati d 13 where e.posizione=d.posizione and e.id < d.id) as rnk 14 from impiegati e 15 ) x 16 group by rnk
Tip precedente: Query a campi incrociati mesi
Tip successivo: Compleanni in un range

MySQL Report un tool di shell per tenere tutto sotto controllo