最近在使用数据库,要对表中一个属性值进行不同范围替代更新,代码如下:
以上形式就可以进行更新替代
update [MedicalData2].[dbo].[PreprocessDataVector6] set Diastolic=3.17 where Diastolic<100
update [MedicalData2].[dbo].[PreprocessDataVector6] set Diastolic=10.72 where Diastolic<110 and Diastolic>=100
update [MedicalData2].[dbo].[PreprocessDataVector6] set Diastolic=23.63 where Diastolic<120 and Diastolic>=110
update [MedicalData2].[dbo].[PreprocessDataVector6] set Diastolic=26.15 where Diastolic<=130 and Diastolic>=120
update [MedicalData2].[dbo].[PreprocessDataVector6] set Diastolic=26.53 where Diastolic<=140 and Diastolic>130
update [MedicalData2].[dbo].[PreprocessDataVector6] set Diastolic=16.33 where Diastolic<150 and Diastolic>140
update [MedicalData2].[dbo].[PreprocessDataVector6] set Diastolic=11.56 where Diastolic<=160 and Diastolic>150以上形式就可以进行更新替代
2282

被折叠的 条评论
为什么被折叠?



