Skip to main content

UPDATE with SET

To renumber the id values to being at 1, the following UPDATE statement:

UPDATE people SET id=id-1;

Row contents will be as follows;
+-------------------+
| id | name | age |
+-------------------+
| 2 | Susan | 15 |
| 1 | Victor | 21 |
+-------------------+

Comments