【发布时间】:2013-12-20 06:15:55
【问题描述】:
这是我之前与我的查询相关的问题。 MySQL select column which is a value in another column
问题是想要对提取的值进行操作并将其存储回原始数据库。我尝试过使用update 和case,但无法实现。
update msisdn_table
CASE reason
WHEN 'NoAnswer' THEN (case when (NoAnswer>0) then update msisdn_table set NoAnswer = NoAnswer-1 end)
WHEN 'NetworkBusy' THEN (case when NetworkBusy>0 then update msisdn_table set NetworkBusy = NetworkBusy-1 end)
WHEN 'CallRejection' THEN (case when CallRejection>0 then update msisdn_table set CallRejection = CallRejection-1 end)
WHEN 'Unavailable' THEN (case when Unavailable>0 then update msisdn_table set Unavailable = Unavailable-1 end)
END
有什么帮助吗?
【问题讨论】: