Updates data in a table.
UPDATE tbl_name SET col_name1=expr [, col_name2=expr] ... [WHERE expr] [LIMIT row_count]
- The first field of type
TIMESTAMP(6)has special behavior for update operations, where it is updated to the current timestamp value when not explicitly updated with a different value. Refer to the discussion of these types in the Data Types topic for more details. In addition, a field
fdeclared with the
ON UPDATE <value>modifier will be updated to
<value>if any other field is updated, but
fitself is not updated.
- MemSQL does not currently support the full multi-table
EXISTSSubqueries in the
WHEREclause of an
UPDATEqueries will fail if
maximum_table_memorylimit has been reached.
- This command must be run on the master aggregator or a child aggregator node (see Node Requirements for MemSQL Commands ).
mysql> UPDATE mytbl SET vehicle_id='X3023X'; mysql> UPDATE mytbl SET vehicle_id='X3023X' WHERE vehicle_model IN (SELECT model FROM all_models);