Search
 
SCRIPT & CODE EXAMPLE
 

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)
Comment

PREVIOUS NEXT
Code Example
Sql :: date to string mariadb 
Sql :: backup a table in sql 
Sql :: sql select second max 
Sql :: mysql database create 
Sql :: mysql alter table add column first 
Sql :: postgres delete all tables 
Sql :: postgres set column equal to another 
Sql :: min salary in sql 
Sql :: cannot drop database because it is currently in use 
Sql :: database disk image is malformed sqlite fix ubuntu 
Sql :: datediff in sql server 
Sql :: select sequence oracle 
Sql :: run mysql file in terminal 
Sql :: Check user permissions on postgres database 
Sql :: mysql utc timestamp 
Sql :: drop multiple columns in sql 
Sql :: oracle first row 
Sql :: current date in postgresql minus 1 day 
Sql :: sql foreign key 
Sql :: alter table add multiple columns postgresql 
Sql :: sql server change schema of a table 
Sql :: how to identify locked tables in sql server 
Sql :: sql sum by column 
Sql :: use float in sql server string 
Sql :: get data every 30 days in sql 
Sql :: run postgresql dump to csv 
Sql :: sql all 
Sql :: install postgresql 10 centos 7 
Sql :: postgre alter table foreign key 
Sql :: mysql login to a specific database terminal 
ADD CONTENT
Topic
Content
Source link
Name
3+3 =