vielleicht interessiert es jemand..hier mal die lösung:
Code:SELECT SUM(anzahl) as gesamt,col FROM ( (SELECT COUNT(*) anzahl, col_1 as col FROM table GROUP BY col_1) UNION (SELECT COUNT(*) anzahl, col_2 as col FROM table GROUP BY col_2)) as t GROUP BY col ORDER BY gesamt DESC, col ASC


LinkBack URL
About LinkBacks
Zitieren