Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR SQL

update using case in mysql

UPDATE `table` SET `uid` = CASE
    WHEN id = 1 THEN 2952
    WHEN id = 2 THEN 4925
    WHEN id = 3 THEN 1592
    ELSE `uid`
    END
WHERE id  in (1,2,3)
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #update #case #mysql
ADD COMMENT
Topic
Name
1+8 =