It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center




已关闭8年。




我在SQL Server 2008中有以下号码:5.4564556
我只想从5.4564556中获取4564556
如果我只能在4564556中得到4(那是小数部分的第一位数字),那就更好了。

我该怎么做?

谢谢

最佳答案

您可以通过以下方式获得前四位小数部分:

select SUBSTRING (PARSENAME(5.4564556,1), 1, 4)

关于asp.net - 在SQL Server中仅获取浮点数的小数部分,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/12129227/

10-12 16:51