- Trending Categories
- Data Structure
- Operating System
- C Programming
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Difference between SCALAR and COLUMN function
The DB2 SCALAR functions take a single column value and returns a single result. The COLUMN function takes the column value from multiple rows of a DB2 table and returns a single result. In case of SCALAR function only one row is involved.
|LENGTH||Gives the length of the column value|
|REPLACE||Used to replace a string with another string|
|CONCAT||Used to combine two or more column values|
|INTEGER||Gives the integer equivalent of the column value|
|CHAR||Gives the character equivalent of the column value|
For example, if we have an ORDERS DB2 table and we want to return only the integer value of the ORDER_TOTAL for all the orders placed on 15-08-2020. We will use the below query.
SELECT ORDER_ID, INTEGER(ORDER_TOTAL) FROM ORDERS WHERE ORDER_DATE = ‘15-08-2020’
In this case, if any ORDER_ID Z55641 is having the ORDER_TOTAL as 3422.89, then we will get the following result.
- Difference between Function and Procedure
- Difference between Method and Function in C#
- Difference between Method and Function in Python
- Difference Between Friend Function and Friend Class
- Difference Between Virtual and Pure Virtual Function
- Difference between Row oriented and column oriented database
- Difference between Function and Predicate in Java 8
- Difference Between Function Overloading and Overriding in C++
- Difference between a virtual function and a pure virtual function in C++
- What is the difference between MySQL stored procedure and function?
- What is the difference between a method and a function?
- What is the difference between MySQL NOW() and CURDATE() function?
- What is the difference between MySQL LENGTH() and CHAR_LENGTH() function?
- Difference between class alv and function alv in SAP ABAP?