ROUND returns a rounded numeric_expression, regardless of data type, when length is a negative number.Проширитабелу ExamplesResult ROUND(748.58, -1) 750.00 ROUND(748.58, -2) 700.00 ROUND(748.58, -3) Results in an arithmetic overflow, because 748.58 defaults to decimal(5,2)...
round(1.235,2) --四舍五入;结果:保留2位小数,1.24 rand() --返回一个0-1之间的随机数;结果:0-1之间的一个随机数 sign(-10) --返回数值符号,结果为 -1、1或0;结果:-1 positive(10) --取原数;结果:10 positive(-10) --取原数;结果:-10 negative(10) --取反;结果:-10 negative(-10) --...
When length is a negative number, numeric_expression is rounded on the left side of the decimal point, as specified by length.function The type of operation to perform. When function is omitted or has a value of 0 (default), numeric_expression is rounded. When a value other than 0 is ...
ROUND(748.58, -4)0 ROUNDreturns a roundednumeric_expression, regardless of data type, whenlengthis a negative number. ExamplesResult ROUND(748.58, -1)750.00 ROUND(748.58, -2)700.00 ROUND(748.58, -3)Results in an arithmetic overflow, because 748.58 defaults todecimal(5, 2), which can't retu...
0 ROUND returns a rounded numeric_expression, regardless of data type, when length is a negative number. Examples Result ROUND(748.58, -1) 750.00 ROUND(748.58, -2) 700.00 ROUND(748.58, -3) Results in an arithmetic overflow, because 748.58 defaults to decimal(5,2), which cannot return 1000....
SQL Overview (SQL Server Compact) + (Add) (SQL Server Compact) + (Positive) (SQL Server Compact) + (String Concatenation) (SQL Server Compact) - (Subtract) (SQL Server Compact) - (Negative) (SQL Server Compact) * (Multiply) (SQL Server Compact) / (Divide) (SQL Server Compact) % (...
SQL Overview (SQL Server Compact) + (Add) (SQL Server Compact) + (Positive) (SQL Server Compact) + (String Concatenation) (SQL Server Compact) - (Subtract) (SQL Server Compact) - (Negative) (SQL Server Compact) * (Multiply) (SQL Server Compact) / (Divide) (SQL Server Compact) % (...
datetime bigint, int, or smallint A negative datetime whose time part is exactly a half-day or in a tick of a half-day is rounded incorrectly (the result is off by 1). DECLARE @h DATETIME = -0.5 SELECT @h, CAST(@h AS INT) 0 -1 datetime or smalldatetime float, ...
DEC_ROUND_DOWN Specifies numbers are rounded towards 0 (truncation). DEC_ROUND_FLOOR Specifies numbers are rounded towards negative infinity. DEC_ROUND_HALF_DOWN Specifies numbers are rounded to nearest; if equidistant, round down. DEC_ROUND_HALF_EVEN Specifies numbers are rounded to nearest; if ...
ROUND always returns a value. Iflength ROUND returns a roundednumeric_expression, regardless of data type, whenlengthis a negative number. The following example shows two expressions that demonstrate by usingROUNDthe last digit is always an estimate. ...