----- Original Message ----- 
From: "Riaan Oberholzer" <[EMAIL PROTECTED]>

> 2-0, 2-1, 2-2, 2-3
> 1-0, 1-1, 1-2, 1-3
> 0-0, 0-1, 0-2, 0-3
>

SELECT CONCAT(predictionA, '-', predictionB) AS score,
COUNT(CONCAT(predictionA, '-', predictionB)) AS count
FROM table
WHERE CONCAT(predictionA, '-', predictionB) > 0
GROUP BY score
ORDER BY predictionA DESC, predictionB

Maybe not the fastest solution, but it is a single query !
The only thing you have to add is that you calculate the grandtotal to
display the "n% has selected.." part

Regards, Jigal.



-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]

Reply via email to