All pastes #423302 Raw Edit

Miscellany

public text v1 · immutable
·published 2007-04-04 01:35 UTC
rendered paste body
select sum(rank) as rank, choice1 from
(
select count(choice1) * 4 as rank, choice1 FROM design_results as first group by choice1
UNION
select count(choice2) * 2 as rank, choice2 FROM design_results as first group by choice2 
UNION
select count(choice3) * 1 as rank, choice3 FROM design_results as first group by choice3
) as tmp
group by choice1
order by rank desc