I have a table with following stucture:
Now I would like to count the amount of "yes" per column over a not defined amount of lines and output a list in descending order: C3 -> 3x C1 -> 1x ...
with something like this i can get the number of yes'es but can not order the list:
count(case when C_1 = '[\"yes\"]' then 1 end) C1_count
Is there an elegant way to loop and sort true the table count and sort to generate the output list? And also be able in cas that C_11 will be added to expand the code?
Thanks a lot for assistance.
