UPDATE TB_Hospital SET HospitalName='xxxx',HospitalAddress='呼和浩特市回民区公园东路6号' WHERE 1=1 AND HospitalName='内蒙古自治区妇幼保健院'
我想要把里面的HospitalName='xxxx', 替换成空格应该怎么写。谢谢
UPDATE TB_Hospital SET HospitalName=REPLICATE(' ', len(HospitalName)),
HospitalAddress='呼和浩特市回民区公园东路6号' WHERE
1=1 AND HospitalName='内蒙古自治区妇幼保健院'
--将HospitalName中每个字符用一个空格替换。
--替换后为' ',即11个空格
WHERE 1=1??不解
UPDATE TB_Hospital SET HospitalName=REPLICATE(HospitalName,'xxxx',' '),HospitalAddress='呼和浩特市回民区公园东路6号' WHERE HospitalName='内蒙古自治区妇幼保健院'
UPDATE TB_Hospital SET HospitalName=REPLACE(HospitalName,'xxxx',' '),HospitalAddress='呼和浩特市回民区公园东路6号' WHERE 1=1 AND HospitalName='内蒙古自治区妇幼保健院'