SELECT
COUNT(DISTINCT val_1) AS val_1_count,
COUNT(DISTINCT val_2) AS val_2_count,
...
FROM ...
vil give dig tællingerne for hvert felt.
SELECT val_1, count(*) as val_1_count
FROM ...
GROUP BY val_1
vil give dig tæller for en værdi. Du kan bruge UNION til at gentage dette for val_1 til val_n i en enkelt (kludgy) forespørgsel.
Hvis du vil have tællingerne over alle felter, skal du have
SELECT val,count(*) as valcount
FROM (
SELECT val_1 AS val FROM ...
UNION ALL
SELECT val_2 AS val FROM ...
...
) AS baseview
GROUP BY val