SQL判断一个数是整数还是小数

DECLARE @number1 AS numeric(10,2),@number2 AS numeric(10,2)
SELECT @number1=10.00,@number2=10.2

SELECT
CASE WHEN CAST(@number1 AS INT)=@number1 THEN '整数' ELSE '小数' END,
CASE WHEN CAST(@number2 AS INT)=@number2 THEN '整数' ELSE '小数' END

GO
SELECT TOP 100
*
FROM AVA_RP_SNR1 b
WHERE b.Methods = 'S'
AND b.SerCardType = 'T'--次数卡
AND CAST(b.Quantity AS INT) <> b.Quantity

上一篇:VS2013,asp.net网站转换为web应用程序


下一篇:-bash: warning: setlocale: LC_CTYPE: cannot change locale (EN_US.UTF-8): No such file or directory