Subject RE: [IB-Architect] Aggregate functions request - FIRST() & LAST()
Author Slavomir Skopalik
I'm not sure about ordering values in agr. functions because order by
specified order of result to client.
It is qustion to core architect, if is posible ordering before aggregating.
UDAFs get to you power of modification
fe: If you need second intead firs, you must add feature requted, but
if you can use of UDAF or similary technique you don't.

sumary for First and Last:
1. core engine MUST guarantee order of values
2. build in or build as UDAF

It's diferent qustions and I think that UDAFs may help to more people
than build in functions, but build in is more stable.

Slavek



> Slavek, I was thinking about something simple to implement, like
> MAX(),MIN()...
>
> MS# SQL Jet Engine:
>
> <<
> SELECT FIRST(field) AS [expression]
> FROM table
> [WHERE ...]
> [GROUP BY ...]
> [ORDER BY ...]
>
> The FIRST function is used to return the value of the first record in the
> designated field Therefore, this function returns a single value. Since the
> records are returned in an arbitrary order, the first record will also be
> arbitrary. You can use the ORDER BY clause to order the records.
>
> The companion LAST function returns the last record in the designated field.
> >>
>
> UDAF brings a new world to agg functions...
>
> How about trying to keep this request open (I think it's easy to implement,
> using the same approach that it's used now for MAX(), MIN(), SUM()....) and
> get back to UDAF's in a different request?
>
> Artur