sql - SubSelects for Order and Count -
i have select this:
select faculty,department,season,student,score table
i want 2 new columns this:
numberinseason order of scores in faculty, department , season.
totalinseason count of students in faculty, department , season.
i think need subselects can not figure out right now. help?
window functions should task:
select faculty, department, season, student, score, dense_rank() on (partition faculty, department, season order score desc) numberinseason, count(*) on (partition faculty, department, season) totalinseason table
Comments
Post a Comment