sql run multiple updates in one query
UPDATE table_name
SET field_name =
case field_name2
when 'value' then 'change_to'
when 'value2' then 'change_to2'
end
sql run multiple updates in one query
UPDATE table_name
SET field_name =
case field_name2
when 'value' then 'change_to'
when 'value2' then 'change_to2'
end
update table sql multiple set
-- CANT do multiple sets but can do case
UPDATE table
SET ID = CASE WHEN ID = 2555 THEN 111111259
WHEN ID = 2724 THEN 111111261
WHEN ID = 2021 THEN 111111263
WHEN ID = 2017 THEN 111111264
END
WHERE ID IN (2555,2724,2021,2017)
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us