Functions are an important concept in DB2. Look for job requirement for data warehousing jobs. If we want to make a report from the data, we use built-in functions to get required output. It simplifies your SQL query.
There are many examples. I am giving my own examples.
“RAMA RAGAVA RANI “
SELECT RTRIM(“RAMA RAGAVA RANI “) FROM SYSIBM.SYSDUMM1 …> You will get result “RAMA RAGAVA RANI “. Means it removes space on right side.
” RAMA RAGAVA RANI “
SELECT LTRIM(” RAMA RAGAVA RANI”) FROM SYSIBM.SYSDUMM1 …> You will get result “RAMA RAGAVA RANI “. Means it removes space on left side.
” RAMA RAGAVA RANI “
SELECT TRIM(” RAMA RAGAVA RANI “) FROM SYSIBM.SYSDUMM1 …> You will get result “RAMA RAGAVA RANI “. Means it removes space on both sides.
The above are beautiful examples. You can use extensively. Refer more built in functions here.
References
- SQL DBA for beginners
- PL/SQL video training for all developers
- Advanced SQL training for senior developers
Related Posts
3 thoughts
Comments are closed.