DB2 built-in functions are great to use to simplify your SQL query. There are different functions available. Alternative functions improve the understanding of SQL query.
I hope you enjoyed my previous post on some built-in functions.
Use Left side functions (alternative functions) instead of Right side functions:
- ABS => ABSVAL
- COALESCE=> VALUE, IFNULL
- DAY=> DAYOFMONTH
- DECIMAL=>DEC
- DOUBLE => FLOAT
- GREATEST => MAX (scalar)
- INTEGER=> INT
- LEAST=> MIN (scalar)
- LOG=> LN
- LOWER => LCASE
- TIMESTAMP_FORMAT => TO_DATE
- TRUNCATE => TRUNC
- UPPER=> UCASE
- VARIANCE=> VAR
- VARIANCE_SAMP => VAR_SAMP
{Ref:IBM and Mullins}
2 thoughts
Comments are closed.