I have a view that returns data in the following way:
GroupID Username Week W L T TBD
1070 jay 1 10 3 0 12
1070 jay 2 11 3 0 1
1070 john 1 14 2 0 15
1070 john 2 15 1 0 19
There are multiple GroupIDs.
Their are multiple Weeks.
I need to set a rank in sql by adding another field to this query called rank.
The rank should be based on most wins and smallest TBD.
If their is a tie for most wins, the smallest TBD decides the winner. If that ties also, then they both get a number 1 rank and so on down the chain.
rank username wins tbd
1 john 10 1
1 jason 10 1
2 mark 8 20
3 mat 4 12
3 kevin 4 12
The issue is that I need to do this for every groupid and every week. So the above eaxple was for group id 1000 and week 1. I now need to rank the next group for week 1 and so on...
Is this possible?
GroupID Username Week W L T TBD
1070 jay 1 10 3 0 12
1070 jay 2 11 3 0 1
1070 john 1 14 2 0 15
1070 john 2 15 1 0 19
There are multiple GroupIDs.
Their are multiple Weeks.
I need to set a rank in sql by adding another field to this query called rank.
The rank should be based on most wins and smallest TBD.
If their is a tie for most wins, the smallest TBD decides the winner. If that ties also, then they both get a number 1 rank and so on down the chain.
rank username wins tbd
1 john 10 1
1 jason 10 1
2 mark 8 20
3 mat 4 12
3 kevin 4 12
The issue is that I need to do this for every groupid and every week. So the above eaxple was for group id 1000 and week 1. I now need to rank the next group for week 1 and so on...
Is this possible?