-- Single Table UPDATE [LOW_PRIORITY] [IGNORE] table_reference [PARTITION (partition_list)] SET col1={expr1|DEFAULT} [,col2={expr2|DEFAULT}] ... [WHERE where_condition] [ORDER BY ...] [LIMIT row_count] -- Multi Table UPDATE [LOW_PRIORITY] [IGNORE] table_references SET col1={expr1|DEFAULT} [, col2={expr2|DEFAULT}] ... [WHERE where_condition] -- Examples UPDATE t1 SET c1=c1+1 WHERE c2=(SELECT MAX(c2) FROM t1); UPDATE table_name SET column1 = value1, column2 = value2 WHERE id=100; UPDATE tab1, tab2 SET tab1.column1 = value1, tab1.column2 = value2 WHERE tab1.id = tab2.id;
SQL Справочник v0.05 © 2007-2025 Igor Salnikov aka SunDoctor