-1

最初の 3 つの算術関数の動作

select CreditLimit,'sum'=CreditLimit+Zip from Customers

select CreditLimit,'sub'=CreditLimit-Zip from Customers

select CreditLimit,'div'=CreditLimit/Zip from Customers

最後の 2 つの芸術関数または動作していない SHOW ERRORE

select CreditLimit,'mod'=CreditLimit%Zip from Customers

ERROR DISPALY: Arithmetic overflow error converting expression to data type smallmoney.

select CreditLimit,'mul'=CreditLimit*Zip from Customers

ERROR DISPALY:The data types smallmoney and nchar are incompatible in the modulo operator.

前進ありがとう友達!

4

1 に答える 1

0

ZIPがデータ型であると思われます。算術演算を実行する前ncharに変換する必要がありますsmallmoney

select CreditLimit,'mod'=CreditLimit%convert(smallmoney,Zip) from Customers
于 2013-01-04T05:21:37.857 に答える