查询中是否可以指定小数点? [英] is it possible to specify the decimal points ?in query
本文介绍了查询中是否可以指定小数点?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
声明@a十进制(18,4),@n int
设置@ n = 1;
设置@ a = 1234.56
选择演员表(@a作为十进制(20,2))
是否可以指定小数位数.
其中@n是点后的位数.
选择cast(@a作为小数(20,@ n))
declare @a decimal(18,4), @n int
set @n=1;
set @a=1234.56
select cast(@a as decimal(20,2))
is it possible to specify the number of decimal number.
where @n is the number of digits after point.
select cast(@a as decimal(20,@n))
推荐答案
没有尝试吗?而且没有报告错误吗?
所以... NO
感叹
Didn''t you try it ? And didn''t it report an error ?
So..... NO
sigh
需要任何解决方案...请帮助
Is dere any solution for it ...pls help
这篇关于查询中是否可以指定小数点?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文