Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.
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;
Join the community of 500,000 technology professionals and ask your questions.