MySQL Update syntax
MySQL Update syntax
The MySQL Update command syntax is as shown below.
UPDATE `TableName` SET `ColumnName` = ‘value’ WHERE condition ;
Example:
UPDATE `emp` SET `salary` = 5000 WHERE EmpID=100;
Update syntax contains three simple parts
The MySQL Update command syntax is as shown below.
UPDATE `TableName` SET `ColumnName` = ‘value’ WHERE condition ;
Example:
UPDATE `emp` SET `salary` = 5000 WHERE EmpID=100;
Update syntax contains three simple parts
- UPDATE `TableName` is the command that tells MySQL to update the data in a table.
- SET `ColumnName` = `value' is the table ColumnName and values of the fields to be affected by the update query.
- “WHERE condition” is used in order to put a filter that reduces the number of records changed by the UPDATE query. In case, you miss it it will update all rows of the table.
Comments
Post a Comment