Updating a column value using Update Statement:
UPDATE statement is used to change the value for a column or to change multiple records using a condition. It is a data manipulation language command which are used for managing data.
Syntax:
UPDATE tablename SET column1=value1,column2=value2,.... columnN WHERE condition;
Example 1:
UPDATE Employee SET EmpName='Rahul ', City='Noida' WHERE EmpID=102;
The above query will change the employee name to Rahul and city 'Noida' for those employee whose Employee Id is 102.
Example 2:
UPDATE Employee SET EmpID=102 WHERE EmpName='Rahul';
The above query will change the employee ID to 102 for those employee whose name is Rahul.
0 Comment(s)