Hi, In order to be able to display the graph I want I have to run two queries. The first query looks like this.

SELECT PercentageScore,COUNT(*) AS 'IndividualFrequency'
FROM resultsets
GROUP BY PercentageScore

I than want to take the IndividualScores and use them again in this Query.

SELECT PercentageScore,CONCAT(100*(IndividualFrequency/32),"%") AS 'PercentageFrequency'
FROM resultsets
GROUP BY PercentageScores.

I am confident this will result in me getting a table with the percentage of people achieving the scores and the scores. Something like this.

PercentageScore PercentageFrequency
100 10%
80 50%
60 30%
40 5%
20 5%
0 0%

I know the percentagescores will look like that as there is only 5 questions. Please could anyone explain to me how I save the 'individualfrequency' to use again!?

Many thanks,


just replace IndividualFrequency in the second query with COUNT(*) !!!

Thank you, so obvious!

Be a part of the DaniWeb community

We're a friendly, industry-focused community of 1.18 million developers, IT pros, digital marketers, and technology enthusiasts learning and sharing knowledge.