Mysql
 sql >> Database >  >> RDS >> Mysql

Conta le occorrenze su più colonne

Se ci sono solo 6 colonne, puoi farlo in un modo

select Number, count(*) From (select Number1 as Number from your_table
union all
select Number2 as Number from your_table
union all
select Number3 as Number from your_table
union all
select Number4  as Number from your_table
union all
select Number5  as Number from your_table
union all
select Number6 as Number from your_table) myTab
group by Number;