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

java - UnknownEntityTypeException: Unable to locate persister (Hibernate 5.0) -

python - ValueError: empty vocabulary; perhaps the documents only contain stop words -

ubuntu - collect2: fatal error: ld terminated with signal 9 [Killed] -