Here I have to update year column with reference to the row id
mysql> update table1 -> set year=case when id=1 then 2000 -> when id=2 then 2001 -> when id=3 then 2000 -> when id=4 then 2001 -> when id=5 then 2000 -> when id=6 then 2001 -> else 2003 -> where id between 1 and 6; ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'where id between 1 and 6' at line 9 mysql>