sql - SELECT columns OVER (PARTITION BY column) -
suppose want retrieve swimmer , time @ 75th percentile each day.
this trying do:
select tablea.date, tablea.swimmer, tablea.time on (partition tablea.date) tablea rank = ceil(0.75 * num_of_swimmers);
but errors @ on statement.
what's best way data need?
thanks!
your error on clause of windowing function requires order clause.
but assuming num_swimmers , why not return
select date, swimmer, time tablea rank = ceil(0.75 * num_of_swimmers)
?
the clause ensure rows returned 75th percentile given day
Comments
Post a Comment