Mysql在REPLACE中转义重计数整数

时间:2015-07-23 18:40:02

标签: mysql

我有一个替换语句用文本替换列中的数值,文本可能包含数字,如何避免重新替换这些数字?

update 
`obsmaintble` 
set
`obsvteduration` = REPLACE(`obsvteduration`, '0', 'No C-Section'), 
`obsvteduration` = REPLACE(`obsvteduration`, '1', 'LOS equal or more than \4 - Given up to discharge'), 
`obsvteduration` = REPLACE(`obsvteduration`, '2', 'LOS equal or more than \4 - Given for < \4 days'),
`obsvteduration` = REPLACE(`obsvteduration`, '3', 'LOS less than \4 Given up to discharge'), 
`obsvteduration` = REPLACE(`obsvteduration`, '4', 'Not given'), 

0 个答案:

没有答案