我正在维护一个至少有 100 行的数据库。每 10 秒进行一次 ajax 调用以更新行。我觉得每 10 秒调用 100 次更新查询是不可取的。所以我遇到了mysql案例,然后和何时将100个查询组合到一个查询并进行更新。但我遇到了代码问题。这是我的两行代码
update customer_details set (date,customer_name,school_name,mobile_number,customer_email,age,area,customer_requirement,extra_comments,draft_message) =
case `id`
when '275' then ('09-04-201','person1','','1234567890','','','','basketball','','message')
when '274' then ( '','','','','','','area','xyz','','message')
end
错误是
#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 '(date,customer_name,school_name,mobile_number,customer_email,age,area,customer_r' at line 1
我无法纠正错误。还有其他方法可以对 100 行进行单个查询调用吗?