MYSQL Update
To update (modify) data in a table UPDATE statement is used. UPDATE can be used in two ways
To update specific rows in a table
To update all rows in a table
Let see simple example
UPDATE students SET student_name=rama where id=100;
The UPADTE statement always begins with the name of the table being updated. In this example, it is the student table. The SET command is then used to assign the new value to a column.
Updating multiple columns
Update STUDENT
SET student_name=hari,
Student_age=11,
Where id=100;
When updating multiple Columns, only a single SET command is used. And each column = value pair is separated by a column. In this example, columns student_name and student_age will both updated for student whose id is 100
|