

- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
What are COLUMN functions in DB2? Explain with the help of an example
The DB2 COLUMN functions are also known as aggregate functions. These functions take the values from a particular column of multiple rows and return a single value.
Below is the list of some most commonly used COLUMN functions.
COLUMN FUNCTION | DESCRIPTION |
SUM | Finds the sum of column values |
COUNT | Count the number of column values |
AVG | Finds the average of column values |
MAX | Finds the maximum value in the column |
MIN | Finds the minimum value in the column |
The COLUMN function can only be used in the SELECT query. For example, if we have to find the average of all the ORDER_TOTAL for the orders placed on 15-08-2020 from the ORDERS table, then we can use the below query.
Example
SELECT AVG(ORDER_TOTAL) FROM ORDERS WHERE ORDER_DATE = ‘15-08-2020’
- Related Questions & Answers
- Explain the concept of DYNAMIC SQL in DB2 with the help of an example
- What is CLUSTERED INDEX in DB2? Explain with the help of practical example.
- What is the difference between DB2 JOIN and UNION? Explain with the help of an example
- What is the use of the VALUE function in a DB2? Explain with the help of an example
- What is NON CLUSTERED INDEX in DB2? Explain with the help of practical example
- Explain join operations with the help of an example in DBMS
- What is the purpose of COALESCE function? Explain with the help of an example.
- Explain the concept of LOCK PROMOTION with the help of an example
- Explain aggregate functions with the help of SQL queries
- Explain asynchronous functions in JavaScript with an example
- Explain SHARED, UPDATE and EXCLUSIVE locks with the help of an example
- What is Fixed-list SELECT? Give the syntax and explain with help of an example
- What are jagged arrays and explain with an example in Java?
- What is a use of SQLWARN3 in a SQLCA? Explain with the help of a practical example?
- What is the character count? Explain with an example?
Advertisements