Reputation: 13
I'm using phpmyadmin and I want if a value in one column is between 1 and 10, then put a 1 in another column, and if it's between 11 and 20 then put a 2...and so on.
Upvotes: 0
Views: 78
Reputation: 204756
update your_table
set another_column = case when some_column between 1 and 10
then 1
when some_column between 11 and 20
then 2
end
Upvotes: 2