LAST

The function LAST returns the last value of items in a group. Without a GROUP BY clause it will return the last row of the SELECT. The value is nondeterministic if the values in a group are differently because there is no warranty of the row order.

SQL Syntax:
 
   LAST( expression )
Parameters:
 
  expression

A expression of any data type without a aggregate function.

Return Type:
 
  the same as the expression.

Examples:

  • SELECT LAST( price ) FROM mytable
  • SELECT LAST( price ) FROM mytable
  • SELECT LAST( price ) FROM mytable t GROUP BY t.name

see also:
FIRST
SQL Aggregate Functions


100% pure Java DBMS
Mirror Site