1--update query example
2 UPDATE table_name
3 SET column1 = value1, column2 = value2, ...
4 WHERE condition;
1UPDATE YourTable
2SET Col1 = OtherTable.Col1,
3 Col2 = OtherTable.Col2
4FROM (
5 SELECT ID, Col1, Col2
6 FROM other_table) AS OtherTable
7WHERE
8 OtherTable.ID = YourTable.ID
1//to update value
2
3UPDATE students SET course_id = 102
4WHERE last_name = 'Jones'; ->
5 if there is no condition it will update all!
1Updates existing data in a table.
2Example: Updates the mileage and serviceDue values for a vehicle with an
3id of 45 in the cars table.
4UPDATE cars
5SET mileage = 23500, serviceDue = 0
6WHERE id = 45;