A SQL UPDATE statement is used to modify existing records in a table. The UPDATE statement requires three main parameters:
1. The table name to be updated
2. The column(s) name to be updated along with new value(s)
3. The rows to be updated
SQL UPDATE Syntax
UPDATE {table_name}
SET column1=value1,column2=value2,...
WHERE condition;
UPDATE operates only on one table at a time. The SET clause specifies the columns and their changed values, and WHERE specifies which of the rows need to be updated.
ITEM table before executing UPDATE statement.
UPDATE ITEM
SET QOH =400
WHERE ItemCode = ‘I1’
Updates QOH to 400 for the item code ‘I1’ in the item table.
1. The table name to be updated
2. The column(s) name to be updated along with new value(s)
3. The rows to be updated
SQL UPDATE Syntax
UPDATE {table_name}
SET column1=value1,column2=value2,...
WHERE condition;
UPDATE operates only on one table at a time. The SET clause specifies the columns and their changed values, and WHERE specifies which of the rows need to be updated.
ITEM table before executing UPDATE statement.
UPDATE ITEM
SET QOH =400
WHERE ItemCode = ‘I1’
Updates QOH to 400 for the item code ‘I1’ in the item table.