sql server - MSSQL Selecting top 10 but include columns with duplicate values -


hi i'm trying top ten winners of competition using score. problem when there 2 users same score example i'm getting top 9 in effect (should eleven records returned if there 2 top 3 scores , rest unique example)...

i'm not sure how tackle , appreciate guidance.

thanks in advance,

ian

should eleven records returned if there 2 top 3 scores

sounds want use dense_rank.

this give rows in top 10 scores.

select t.score (        select score,               dense_rank() over(order score) rn        yourtable      ) t t.rn <= 10 

se-data


Comments

Popular posts from this blog

django - How can I change user group without delete record -

java - Need to add SOAP security token -

java - EclipseLink JPA Object is not a known entity type -