1UPDATE table_name
2SET variable = 'changed field', variable = 'another changed field'
3WHERE firstline_name = 1;
1UPDATE table_name SET field1 = 'value 1', field2 = 'value 2'
2WHERE field3 = 'value 3'
3
1-- Set New Employee Password
2UPDATE employee
3SET employee.password = '1234'
4WHERE employee.email = 'emp@gmail.com';
1UPDATE tableName SET anAttribute = 'Something' WHERE anOtherAttribute = 'SomethingElse'
2
3//All 'SomethingElse' values will become 'Something'
1UPDATE [LOW_PRIORITY] [IGNORE] table_name
2SET
3 column_name1 = expr1,
4 column_name2 = expr2,
5 ...
6[WHERE
7 condition];
1-- Things in brackets are optional
2-- IGNORE modifier updates rows even if errors occur (ie: the rows that cause errors are simply not updated)
3UPDATE [IGNORE] table_name
4SET
5 column_name1 = expr1,
6 column_name2 = expr2,
7 ...
8[WHERE
9 condition]; -- WHERE tells us which rows to update based on said condition