I need a different random number for each row in my table. The following seemingly obvious code uses the same random value for each row.
SELECT table_name,
select round(rand(checksum(newid()))*(10)+20,2)
Here the random number will come in between 20 and 30. round will give two decimal place maximum.
round
If you want negative numbers you can do it with
select round(rand(checksum(newid()))*(10)-60,2)
Then the min value will be -60 and max will be -50.