まず、商品ごとに、それぞれの選択肢に何票投票されたかを集計するViewを作成します。これでデータの持ち方が正規刑になるので応用が利きやすくなります。
SQL
1CREATE OR REPLACE VIEW Poll(name, answer, total) AS
2 SELECT name, answer, SUM(cnt)
3 FROM (
4 SELECT name, '1' AS answer, SIGN(INSTR(answer, '1')) AS cnt FROM Survey
5 UNION ALL SELECT name, '2' AS answer, SIGN(INSTR(answer, '2')) AS cnt FROM Survey
6 UNION ALL SELECT name, '3' AS answer, SIGN(INSTR(answer, '3')) AS cnt FROM Survey
7 UNION ALL SELECT name, '4' AS answer, SIGN(INSTR(answer, '4')) AS cnt FROM Survey
8 UNION ALL SELECT name, '5' AS answer, SIGN(INSTR(answer, '5')) AS cnt FROM Survey
9 ) T
10 GROUP BY name, answer;
あとは以下のようなSQLで実現できるかと思います。
SQL
1SELECT
2 name,
3 MAX(CASE WHEN rnk = 0 THEN answer END) best1,
4 MAX(CASE WHEN rnk = 1 THEN answer END) best2,
5 MAX(CASE WHEN rnk = 2 THEN answer END) best3
6FROM (
7 SELECT
8 name,
9 answer,
10 (SELECT COUNT(*) FROM Poll P2 WHERE P1.name = P2.name AND P1.total < P2.total) AS RNK
11 FROM Poll P1
12) T
13GROUP BY name