sql - SubSelects for Order and Count -


i have select this:

select faculty,department,season,student,score table 

i want 2 new columns this:

sample result set

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

Popular posts from this blog

javascript - Trigger mouseenter when an animated element touches mouse -

json - Zend error Connection -

java - Using Spring @Transactional with a combination of readOnly and write, when does this entity get committed? -