Reputation: 1
Sorry if the question was asked before i try search but not found. I'm still new on mssql so maybe the answer are obvious just i cant find.
My current query is:
SELECT gold_min, gold_max, gold_min_2, gold_max_2
FROM m_rdb
I want to divide the values on current columns by 20 and then update, just not sure how to do. Any help are welcome.
Upvotes: 0
Views: 136
Reputation: 6079
If your updating the values to same columns then
Update m_rdb SET gold_min = gold_min/20, gold_max=gold_max/20,
gold_min_2=gold_min_2/20, gold_max_2=gold_max_2/20
If your updating the values to Other columns then
Update m_rdb SET gold_min_other = gold_min/20, gold_max_other=gold_max/20,
gold_min_2_other=gold_min_2/20, gold_max_2_other=gold_max_2/20
Upvotes: 0