我有一张学生信息表
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
这篇关于修改现有小数位信息的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持html5模板网!
多次指定相关名称“CONVERT"The correlation name #39;CONVERT#39; is specified multiple times(多次指定相关名称“CONVERT)
T-SQL 左连接不返回空列T-SQL left join not returning null columns(T-SQL 左连接不返回空列)
从逗号或管道运算符字符串中删除重复项remove duplicates from comma or pipeline operator string(从逗号或管道运算符字符串中删除重复项)
将迭代查询更改为基于关系集的查询Change an iterative query to a relational set-based query(将迭代查询更改为基于关系集的查询)
将零连接到 sql server 选择值仍然显示 4 位而不是concatenate a zero onto sql server select value shows 4 digits still and not 5(将零连接到 sql server 选择值仍然显示 4 位而不是 5)
SQL 显示两个日期之间的月份和年份SQL to display both month and year between two dates(SQL 显示两个日期之间的月份和年份)