Download this FREE eBook and learn all you need to get started with Windows Nano Server, including deployment options, remote management
and troubleshooting tips and tricks
SELECT grade_level, MAX(CASE WHEN rn = 1 THEN cnt END) first_result, MAX(CASE WHEN rn = 2 THEN cnt END) second_result, MAX(CASE WHEN rn = 3 THEN cnt END) third_result, SUM(cnt) total_enrolled FROM (SELECT q.*, ROW_NUMBER() OVER(PARTITION BY grade_level ORDER BY home_room) rn FROM ( SELECT grade_level, home_room, COUNT(*) cnt FROM students WHERE enroll_status = 0 AND schoolid IN (3) GROUP BY home_room, grade_level) q) GROUP BY grade_level ORDER BY grade_level;
Add your voice to the tech community where 5M+ people just like you are talking about what matters.
Join the community of 500,000 technology professionals and ask your questions.