Re: converting multiple update queries into case statement
Try this query -
UPDATE
`smf_members`
SET
id_group =
CASE
WHEN (CURDATE() < startdate) THEN '24'
WHEN (CURDATE() BETWEEN startdate AND enddate) THEN '23'
WHEN (CURDATE() > enddate)THEN '20'
END;
Devart Company,
MySQL management tools
http://www.devart.com/dbforge/mysql/
Subject
Written By
Posted
Re: converting multiple update queries into case statement
August 17, 2010 12:00AM
Sorry, you can't reply to this topic. It has been closed.
Content reproduced on this site is the property of the respective copyright holders.
It is not reviewed in advance by Oracle and does not necessarily represent the opinion
of Oracle or any other party.