SELECT ROUND(percentage*100 ,1)||’%’ AS percenage
FROM (SELECT SUM(comb_score)/6366.0 percentage
FROM (SELECT user, SUM(score) comb_score
FROM hacker_news
GROUP BY 1
HAVING comb_score > 200
ORDER BY 2 DESC) t1 )t2
I WROTE THE PREVIOUS QUERY , BASED ON A QUESTION AT PROJECT 2 AGGREGATION . THE QUESTION NUMBER 4 : Then, we want to add these users’ score
s together and divide by the total to get the percentage ,
CAN ANY ONE HELP ME TO WRITE THE SUM(score) function instead of the number 6366.0.