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


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.


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.

The following is an example that returns the minimum number of gold medals Korea won in the Olympics. (demodb)

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


=== <Result of SELECT Command in Line 1> ===