根据where子句更改表字段

时间:2012-06-12 06:10:36

标签: mysql

我需要根据查询更改一些字段:

SELECT *
FROM  IP_cases_prelim
WHERE DRG = '470' AND PRINCIPLE_PROC_CD = '8154' 
      AND `Treatment Category Code` = '00601';

它在6000个表中找到254条记录。

我现在需要将“治疗类别代码”更改为“00601”至“00801”

建议?

谢谢

2 个答案:

答案 0 :(得分:0)

尝试 update 声明:

UPDATE IP_cases_prelim 
SET 'Treatment Category Code' = '00801'
WHERE DRG = '470' AND PRINCIPLE_PROC_CD = '8154' AND Treatment Category Code = '00601';

答案 1 :(得分:0)

这个怎么样。

UPDATE IP_cases_prelim
SET    'Treatment Category Code' = '00801'
WHERE  DRG = '470' AND PRINCIPLE_PROC_CD = '8154' 
       AND 'Treatment Category Code' = '00601';