SQL Query : Selecting top N rows for each group in a table
i am facing a very common issue regarding "Selecting top N rows for each group in a table"

let's say I have a table with id, name, hair_colour, score columns.

Now i want a result such that , from each hair colour get me top 3 scorer names.

To solve this i got exactly what i need on 

http://rickosborne.org/blog/index.php/2008/01/07/sql-getting-top-n-rows-for-a-grouped-query/

But that won't work as expected when my scores are equal.
In above example the result as follow.

id  name  hair  score  ranknum
12  Kit  Blonde  10  1
9  Becca  Blonde  9  2
8  Katie  Blonde  8  3
3  Sarah  Brunette 10  1    
4  Deborah Brunette 9  2 - ------- - - > if
1  Kim  Brunette 8  3


if  4 Deborah Brunette 9 2 - ------- - - > if this also has same score as 10 same as Sarah then ranknum will be 2,2,3 for "Brunette" type of hair.

So anybody has solution to that...

SQL Query : Selecting top N rows for each group in a table
===

i am facing a very common issue regarding "Selecting top N rows for each group in a table"

let's say I have a table with id, name, hair_colour, score columns.

Now i want a result such that , from each hair colour get me top 3 scorer names.

To solve this i got exactly what i need on 

http://rickosborne.org/blog/index.php/2008/01/07/sql-getting-top-n-rows-for-a-grouped-query/

But that won't work as expected when my scores are equal.
In above example the result as follow.

id  name  hair  score  ranknum
12  Kit  Blonde  10  1
9  Becca  Blonde  9  2
8  Katie  Blonde  8  3
3  Sarah  Brunette 10  1    
4  Deborah Brunette 9  2 - ------- - - > if
1  Kim  Brunette 8  3


if  4 Deborah Brunette 9 2 - ------- - - > if this also has same score as 10 same as Sarah then ranknum will be 2,2,3 for "Brunette" type of hair.

So anybody has solution to that...
