假设我有4.9的值。
我想分4和.9 ..。我该怎么做呢?
我可以使用FLOOR()来隔离4。那.9呢?我怎样才能隔离它呢?
我使用的是t-sql sql server 2005/2008
发布于 2010-10-10 03:08:05
4.9%1你可以做模除1。
发布于 2010-12-21 21:20:37
Declare @money money
Set @money = 418.75
Select convert(int,@money - (@money % 1)) as 'LeftPortion'
,convert(int, (@money % 1) * 100) as 'RightPortion'发布于 2010-10-10 03:14:50
我能想到的最简单的方法就是
SELECT IntegerPart = cast(4.9 AS int), DecimalPart = 4.9 - cast(4.9 AS int)https://stackoverflow.com/questions/3897473
复制相似问题