UPDATE table_name SET column1=value1, column2=value2 WHERE condition
UPDATE Customers SET City='Oslo'
UPDATE Table_name
-- The desired value
SET Column_name = desired_value
-- Any value, of the item, of which one value you want to change
WHERE Column_name = value
UPDATE table_name SET field1 = new-value1, field2 = new-value2
[WHERE Clause]
ALTER TABLE t1 MODIFY post_date TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP
mysql> update updateIfConditionDemo set UserAge =if(UserAge =23,26,UserAge);
Query OK, 4 rows affected (0.20 sec)
Rows matched: 5 Changed: 4 Warnings: 0
CREATE TABLE copy LIKE original;
ALTER TABLE copy DISABLE KEYS;
SET unique_checks=0; SET foreign_key_checks=0;
INSERT INTO copy SELECT * FROM original;
ALTER TABLE copy ENABLE KEYS;
SET unique_checks=1; SET foreign_key_checks=1;