True, we don't support these OLAP extensions yet, but in these cases, if there's standard SQL syntax, we try to use it and support as much as we can. So instead of calling the functions FIRST_BY and LAST_BY, we could call them FIRST_VALUE and LAST_VALUE, not allow the PARTITION BY clause (since as you've pointed out, we don't have support for this yet), but support the other parts of the standard syntax like this:

    FIRST_VALUE | LAST_VALUE
    ( expression ) OVER
    ( [ ORDER BY order_list ] )

Then we could support an NTH_VALUE function too, as above, but with the additional argument you built-in allows:

    NTH_VALUE
    ( expression, offset ) OVER
    ( [ ORDER BY order_list ] )

All of these are just the "syntax" - they'd all compile into the built-in function you've implemented which wouldn't need to change. Both Oracle and Postgres have this NTH_VALUE function: http://www.postgresql.org/docs/8.4/static/functions-window.html