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