OSEC

Neohapsis is currently accepting applications for employment. For more information, please visit our website www.neohapsis.com or email hr@neohapsis.com
help me out for this problem...

From: MuraliKrishna (murali_krishnaarthaoptions.com)
Date: Fri Feb 05 2010 - 06:03:44 CST


 

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>