sql - Trying to rank by group on a query -


i have query in trying group position , rank final value.

select qryprospects.[prospect name]        , qryprospects.position        , qryprospects.height        , qryprospects.weight        , qryprospects.college        , qryprospects.roundid        , round([avgofaggregate],2) [true value]        , round([avgofaggregate]*[multiplier]*[needmultiplier],2) [final value]        , qryprospects.prospectid       qryprospects        inner join qrycalculations on qryprospects.prospectid = qrycalculations.prospectid; 

so results rank qb's 1 being highest, rbs same, of wr's, etc....

any appreciation!

use derived table. try this

select [prospect name]        , position        , height        , weight        , college        , roundid        , [true value]        , [final value]        , prospectid   (select qryprospects.[prospect name]                , qryprospects.position                , qryprospects.height                , qryprospects.weight                , qryprospects.college                , qryprospects.roundid                , round([avgofaggregate],2) [true value]                , round([avgofaggregate]*[multiplier]*[needmultiplier],2) [final value]                , qryprospects.prospectid               qryprospects                inner join qrycalculations on qryprospects.prospectid = qrycalculations.prospectid)     qb_order  group position  order [final value] 

Comments

Popular posts from this blog

apache - PHP Soap issue while content length is larger -

asynchronous - Python asyncio task got bad yield -

javascript - Complete OpenIDConnect auth when requesting via Ajax -