--update query example
UPDATE table_name
SET column1 = value1, column2 = value2, ...
WHERE condition;
UPDATE Supplier
SET Phone = '(03) 8888-5011'
WHERE id = '513'
UPDATE Customers
SET first_name = 'Johnny'
WHERE customer_id = 1;
UPDATE `table_name` SET `status` = '555' WHERE `product_id` = 2386
UPDATE employees SET name = 'Jack' WHERE name = 'Jackson';
UPDATE `table_name` SET `column1` = value1, `column2` = value2 WHERE condition;
SQL> UPDATE CUSTOMERS
SET ADDRESS = 'Pune'
WHERE ID = 6;
UPDATE mytable t -- Update using WITH statement
SET value3 = (
WITH comp AS (
SELECT id, value1
FROM mytable t
WHERE value2 > 10
)
SELECT c.value1
FROM comp c
WHERE c.id = t.id
);
UPDATE
student
SET
registration_date = CAST('2019-09-25' AS DATETIME)
WHERE
id = 25;
UPDATE table_name
SET column_name1 = value1, column_name2 = value2
WHERE condition;
UPDATE table_name
SET column1 = value1, column2 = value2, ...
WHERE condition;