Difference between revisions of "SQL MIN()"
From Lianjapedia
Yvonne.milne (Talk | contribs) |
|||
(One intermediate revision by one other user not shown) | |||
Line 1: | Line 1: | ||
==Purpose== | ==Purpose== | ||
Returns a minimum value in a SELECT statement | Returns a minimum value in a SELECT statement | ||
− | |||
==Syntax== | ==Syntax== | ||
− | MIN(< | + | MIN(<expr1> [, <expr2> [, ...]]) |
− | + | ||
==See Also== | ==See Also== | ||
[[SQL Aggregate Functions|AGGREGATES]], [[AVG()]], [[COUNT()]], [[SQL MAX()|MAX()]], [[SQL SELECT|SELECT]], [[SUM()]] | [[SQL Aggregate Functions|AGGREGATES]], [[AVG()]], [[COUNT()]], [[SQL MAX()|MAX()]], [[SQL SELECT|SELECT]], [[SUM()]] | ||
− | |||
==Description== | ==Description== | ||
− | Returns the minimum value of < | + | Returns the minimum value of <expr1> or the list of expressions (list supported from v6.0). |
+ | The expressions can be of the following data types: | ||
+ | * Numeric | ||
+ | * Date | ||
+ | * Character (from v6.0) | ||
+ | * Currency (from v6.0) | ||
+ | * Datetime (from v6.0) | ||
==Example== | ==Example== | ||
<code lang="recital"> | <code lang="recital"> | ||
− | + | open database southwind | |
+ | select min(orderdate,requireddate,shippeddate) from orders | ||
+ | select min(companyname) from customers | ||
</code> | </code> | ||
− | |||
− | |||
− | |||
[[Category:Documentation]] | [[Category:Documentation]] | ||
[[Category:SQL|MIN()]] | [[Category:SQL|MIN()]] | ||
[[Category:Functions]] | [[Category:Functions]] | ||
[[Category:SQL Functions]] | [[Category:SQL Functions]] | ||
+ | [[Category:Lianja v6.0]] |
Latest revision as of 06:37, 23 February 2021
Contents
Purpose
Returns a minimum value in a SELECT statement
Syntax
MIN(<expr1> [, <expr2> [, ...]])
See Also
AGGREGATES, AVG(), COUNT(), MAX(), SELECT, SUM()
Description
Returns the minimum value of <expr1> or the list of expressions (list supported from v6.0).
The expressions can be of the following data types:
- Numeric
- Date
- Character (from v6.0)
- Currency (from v6.0)
- Datetime (from v6.0)
Example
open database southwind select min(orderdate,requireddate,shippeddate) from orders select min(companyname) from customers