What is the difference between the MAX() and MIN() functions in DB2?

  • MAX() function can be used only on indexed columns, whereas MIN() function can be used on any column.
  • MAX() function ignores NULL values, whereas MIN() function treats NULL values as the lowest possible value.
  • MAX() function is used for text data types, whereas MIN() function is used for numeric data types.
  • MAX() function returns the maximum value from a column, while MIN() function returns the minimum value from a column.
The MAX() function retrieves the largest value from a specified column in a table. On the other hand, the MIN() function retrieves the smallest value from a specified column. Both functions are aggregate functions commonly used in SQL queries to perform calculations on sets of values. The key difference lies in the values they retrieve based on the specified column. 
Add your answer
Loading...

Leave a comment

Your email address will not be published. Required fields are marked *