-2
SELECT CAST(960 AS NUMERIC(18,2)) -- it gives 960.00 
SELECT CAST(178.5 AS NUMERIC(18,2)) -- it gives 178.50

我需要结果 960 和 178.5,我该怎么做

4

1 回答 1

0

在下面使用

SELECT CAST(960 AS NUMERIC(18,0)) -- it will give 960

SELECT CAST(178.5 AS NUMERIC(18,1)) -- it will give 178.5
于 2013-08-23T12:22:23.773 回答