Home db2 date functions.
Floor function in db2.
The argument can also be a character string or graphic string data type.
Floor numeric expression the schema is sysibm.
The transformation of the value is based on the scalar function being applied and the value itself.
Sql mod function is used to get the remainder from a division.
Mod dividend divider postgresql and oracle.
Additional built in functions were added for db2 v7 and v8 as well.
The floor function returns the largest integer value that is less than or equal to the argument.
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.
Floor expression the schema is sysibm.
The int function short for integer is like the floor function but some calculators and computer programs show different results when given negative numbers.
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.
The result of a scalar function is a transformed version of the column or expression being operated on.
This section introduces you to some common db2 date functions that help you manipulate date and time data effectively.
In addition the numbers on the right side of the decimal point went to zero.
The following example shows positive numeric negative numeric and currency values with the floor function.
In the above statement the round function rounded up the last digit of the number on the left of the decimal point.
Returns a datetime value that represents the first argument plus a specified number of days.
All of above platforms support the sql syntax of mod.
The sql distinct command along with the sql mod function is used to retrieve only unique records depending on the specified column or expression.
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.
The argument must be an expression that returns a value of any built in numeric data type.
Select floor 123 45 floor 123 45 floor 123 45.
The sql floor function rounded up any positive or negative decimal value down to the next least integer value.
And this is the ceiling function.
Some say int 3 65 4 the same as the floor function.