本文介绍了计算列中的位数的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
这是我的代码
select len(cast(code as float)),code from tbl1 where code is not null这是输出:
我想在代码栏中输入数字。 我不明白为什么最后一个计数为12而不是8?
I want a count of digits in the code column. I don't understand why the last one is counted as 12 and not 8?
推荐答案将其作为 int 代替:
select len(cast(code as int)), code from tbl1 where code is not null;大概是某种十进制值正在计数。
Presumably, some sort of decimal values are getting counted.
更多推荐
计算列中的位数
发布评论