Max (open)

Aggregate function which returns the highest value.

Syntax

// Core function, no LOADLIB necessary

VARIANT FUNCTION Max(VARIANT data)

Parameters

VARIANT data

Array of expressions

Return value

VARIANT

Returns the expression with the highest value

Description

Max is an aggregate function which can be used in SELECT statements, and which returns the expression with the highest value in a group. Max can only be used within a SELECT statement, and specifically only in the HAVING, ORDER BY clauses and in the list of selected cells.

Examples

// Show per car maker which model is the most expensive
  SELECT maker, Max(price)
    FROM car_types
GROUP BY maker