UPDATE a_timeblock SET timeblock_due_date=DATE(timeblock_next_update),
CASE timeblock_recurrence_unit
WHEN day THEN
DATE_ADD(NOW(),INTERVAL timeblock_recurrence_time day )
WHEN month THEN
DATE_ADD(NOW(),INTERVAL timeblock_recurrence_time month)
END
WHERE timeblock_recurrence=1 AND timeblock_complete=0 AND timeblock_next_update=
FROM_UNIXTIME(1337662800)
上面的查询是错误的。我想做类似上面的事情。如果可能的话,我该怎么做。
#1064 - 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
'CASE timeblock_recurrence_unit WHEN 'day' THEN DATE_ADD(NOW(),IN' at line 2