String functions ascii char charindex concat concat with concat ws datalength difference format left len lower ltrim nchar patindex quotename replace replicate reverse right rtrim soundex space str stuff substring translate trim unicode upper numeric functions abs acos asin atan atn2 avg ceiling count cos cot degrees exp floor log log10 max.
Floor function in db2.
In the above statement the round function rounded up the last digit of the number on the left of the decimal point.
The floor function returns the largest integer value that is less than or equal to the argument.
The following example shows positive numeric negative numeric and currency values with the floor function.
Sql mod function is used to get the remainder from a division.
The int function short for integer is like the floor function but some calculators and computer programs show different results when given negative numbers.
And this is the ceiling function.
Some database systems such as microsoft sql sever ibm db2 sybase ase display the zero 00 after the decimal point of the number while the other e g oracle database postgresql mysql do not.
Mod dividend divider postgresql and oracle.
The argument can also be a character string or graphic string data type.
All of above platforms support the sql syntax of mod.
Returns a datetime value that represents the first argument plus a specified number of days.
Some say int 3 65 4 the same as the floor function.
The result of a scalar function is a transformed version of the column or expression being operated on.
The result is the integer part of the calculated value in the same data type as numeric expression.
Additional built in functions were added for db2 v7 and v8 as well.
The sql distinct command along with the sql mod function is used to retrieve only unique records depending on the specified column or expression.
The sysfun version of the floor function continues to be available expression an expression that returns a value of any built in numeric data type.
This section introduces you to some common db2 date functions that help you manipulate date and time data effectively.
Returns the largest integer value less than or equal to the argument.
In addition the numbers on the right side of the decimal point went to zero.
Floor numeric expression the schema is sysibm.
The argument must be an expression that returns a value of any built in numeric data type.
Sql distinct along with the sql floor function is used to retrieve only unique value after rounded down to the next least integer value depending on the column specified.
Select floor 123 45 floor 123 45 floor 123 45.
The transformation of the value is based on the scalar function being applied and the value itself.