问题描述
我有一张学生信息表
StudentID HDT Code NAME 1233 3300 100.01 Jorge 1234 3301 1233.01 Steve 1235 3300 155.32 Jessica 5536 3300 568.22 Tim
对于 HDTYPID 3300 我想在小数位添加 0
For HDTYPID 3300 I want to add 0 in the decimal place
StudentID HDT Code NAME 1233 3300 100.001 Jorge 1234 3301 1233.01 Steve 1235 3300 155.032 Jessica 5536 3300 568.022 Tim
我尝试过这种格式,但它没有添加 0
I tried with the format but it doesn't add 0
推荐答案
使用字符串的最简单方法.
Easiest way with a string.
UPDATE StudentInfo SET HDCOD=REPLACE(HDCOD,'.','.0') WHERE HDTYPID=3300