How do I find percentage
This is not working
Can anyone suggest?
SELECT DISTINCT a.apple, (CAST((Count(a.apple))/ (SELECT count(a.apple) from a) *100 AS DECIMAL (15,2) )) AS percentage
FROM a
GROUP BY a.apple;
Forums:
How do I find percentage
This is not working
Can anyone suggest?
SELECT DISTINCT a.apple, (CAST((Count(a.apple))/ (SELECT count(a.apple) from a) *100 AS DECIMAL (15,2) )) AS percentage
FROM a
GROUP BY a.apple;