Using a loop over the column list is rather slow. Would there be a way to do it with a single 'table scan'? Example: Source Table:
FRUIT COLOR
Apple Red
Apple Red
Apple Yellow
Pear Yellow
Pear Yellow
Desired output:
COLUMN LEVEL COUNT
FRUIT Apple 3
FRUIT Pear 2
COLOR Red 2
COLOR Yellow 3
Again, the goal is to get the 1-way frequencies of multiple categorical variables in an efficient manner.