这个SQL状态中的零数是多少 [英] What does the zero number in this SQL statemen
问题描述
你好,
目前我试图理解,这是做什么的:
convert ( varchar ( 20 ),((preis)* @ prozent), 0 ) as PreisPro
据我所知,它使用字段preis,将其转换为varchar(20),将其与变量@Prozent(百分比)相乘并将其显示为 PreisPro。
但@Prozent之后的零号究竟是什么?
我' m使用MS-SQL。
我尝试过:
我查看了: CAST和CONVERT(Transact-SQL)| Microsoft Docs [ ^ ]。
我找到了漂浮和真实风格的表格。该数字是0吗?
这是一个风格代码: SQL Server CONVERT()函数 [ ^ ] - 它仅用于DateTimes,Floats和Money。
在这种情况下,它可能指定没有逗号分隔符,小数点右边2位数,如链接中所示
Hello,
currently i tried to understand, what this does:
convert(varchar(20),((preis)*@prozent),0) as PreisPro
So far as i understand, it uses the field "preis", converts it to varchar(20), multiplies it with the variable "@Prozent" (Percent) and gives it out as "PreisPro".
But what exactly does the Zero number after "@Prozent"?
I'm using MS-SQL.
What I have tried:
I looked into: CAST and CONVERT (Transact-SQL) | Microsoft Docs[^].
There i found the table "float and real styles". Is that number "0" meant?
It's a "style" code: SQL Server CONVERT() Function[^] - it's only used for DateTimes, Floats, and Money.
In this case, it probably specifies "No comma delimiters, 2 digits to the right of decimal" as it says in the link.
这篇关于这个SQL状态中的零数是多少的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!