I would like to add numbers to my rows based on the product value:
Lets say Ive got table:
ProductId Value
001 10
002 30
003 20
then when I order it by Value asc I would get:
ProductId Value
001 10
003 20
004 30
Now I want to add new column called Position and the result would be like this:
ProductId Value Position
001 10 1
002 30 3
003 20 2
Thanks for any help how can I do this.
My database serrver is sql server 2008R2