The FIRST_VALUE function allows you to select the first value (according to some ordering) in a table, without having to use
a self-join. This is valuable when you want to use the first value as the baseline in calculations.

The FIRST_VALUE function takes the first record from the window. Then, the expression is computed against the first record and results are returned.

If IGNORE NULLS is specified, the first non-NULL value of expression is returned. If RESPECT NULLS is specified (the default), the first value is returned whether or not it is NULL.

The FIRST_VALUE function is different from most other aggregate functions in that it can only be used with a window specification.

Elements of window-spec can be specified either in the function syntax (inline), or in conjunction with a WINDOW clause in the SELECT statement.
See the window-spec definition provided in WINDOW clause.

For more information about using window functions in SELECT statements, including working examples, see Window functions.

SQL Anywhere supports SQL/2008 language feature F441, "Extended set function support", which permits operands of window functions
to be arbitrary expressions that are not column references.

SQL Anywhere does not support optional SQL/2008 feature F442, "Mixed column references in set functions". SQL Anywhere does
not permit the arguments of an aggregate function to include both a column reference from the query block containing the FIRST_VALUE
function, combined with an outer reference. For an example, see the AVG function [Aggregate]

Employee 1658 is the first row for department 500, indicating that they are the most recent hire in that department and their
percentage is 100%. Percentages for the remaining department 500 employees are calculated relative to that of employee 1658.
For example, employee 1570 earns approximately 139% of what employee 1658 earns.

If another employee in the same department makes the same salary as the most recent hire, they will have a percentage of 100
as well.