FIRST

The function FIRST returns the first value of items in a group. Without a GROUP BY clause it will return the first 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:
 
   FIRST( expression )
Parameters:
 
  expression

A expression of any data type without a aggregate function.

Return Type:
 
  the same as the expression.

Examples:

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

see also:
LAST
SQL Aggregate Functions


100% pure Java DBMS
Mirror Site