Answers for "update query for multiple columns"

SQL
4

sql update multiple columns from another table

-- Oracle
UPDATE table2 t2 SET (VALUE1, VALUE2) = 
    (SELECT COL1 AS VALUE1, COL1 AS VALUE2 FROM table1 t1 WHERE t1.ID = t2.ID);
-- SQL Server
UPDATE table2 t2 SET
    t2.VALUE1 = t1.COL1,
    t2.VALUE2 = t1.COL2
FROM table1 t1
INNER JOIN t2 ON t1.ID = t2.ID;
-- MySQL
UPDATE table2 t2 INNER JOIN table1 t1 USING (ID)
SET T2.VALUE1 = t1.COL1, t2.VALUE2 = t1.COL2;
Posted by: Guest on January-23-2021
10

update multiple columns in sql

UPDATE table-name SET column-name = value, column-name = value WHERE condition = value
Posted by: Guest on April-28-2020
4

update query for multiple columns

UPDATE Person.Person
 Set FirstName = 'Kenneth'
    ,LastName =  'Smith'
 WHERE BusinessEntityID = 1
Posted by: Guest on March-18-2020

Code answers related to "update query for multiple columns"

Code answers related to "SQL"

Browse Popular Code Answers by Language