SQL LAST_VALUE with debugging
SQL LAST_VALUE with error handling
SQL LAST_VALUE with user-defined function type
SQL LAST_VALUE with stored procedure type
SQL LAST_VALUE with table type