Difference between revisions of "SQL MAX()"
From Lianjapedia
Helen.george (Talk | contribs) |
Yvonne.milne (Talk | contribs) |
||
Line 3: | Line 3: | ||
==Syntax== | ==Syntax== | ||
− | MAX(< | + | MAX(<expr1> [, <expr2> [, ...]]) |
==See Also== | ==See Also== | ||
Line 9: | Line 9: | ||
==Description== | ==Description== | ||
− | Returns the maximum value of < | + | Returns the maximum 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 max(orderdate,requireddate,shippeddate) from orders | ||
+ | select max(companyname) from customers | ||
</code> | </code> | ||
Line 20: | Line 29: | ||
[[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 maximum value in a SELECT statement
Syntax
MAX(<expr1> [, <expr2> [, ...]])
See Also
AGGREGATES, AVG(), COUNT(), MIN(), SELECT, SUM()
Description
Returns the maximum 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 max(orderdate,requireddate,shippeddate) from orders select max(companyname) from customers