Open Source RDBMS - Seamless, Scalable, Stable and Free

한국어 | Login |Register

Versions available for this page: CUBRID 8.2.1 |  CUBRID 8.3.0 |  CUBRID 8.3.1 |  CUBRID 8.4.0 |  CUBRID 8.4.1 |  CUBRID 8.4.3 |  CUBRID 9.0.0 | 



MIN Function

Description

The MIN function gets the smallest value of expressions of all rows. Only one expression is specified.

For expressions that return character strings, the string that appears earlier in alphabetical order becomes the minimum value; for those that return numbers, the smallest value becomes the minimum value.

Syntax

MIN ( [ { DISTINCT | DISTINCTROW } | UNIQUE | ALL ] expression )

  • expression : Specifies an expression that returns a numeric or string value. A collection expression cannot be specified.
  • ALL : Gets the minimum value for all data (default).
  • DISTINCT or UNIQUE : Gets the maximum value without duplicates.
Example

The following example shows how to retrive the minimum number of gold medals that Korea won in the Olympics (demodb).

SELECT MIN(gold) FROM participant WHERE nation_code = 'KOR';

    min(gold)

=============

            7