Re: SQL TRICK. Select rowid, max(...)
Posted in 1994
DoctorQ Komputery i Programy — — source: Informix-list mailing list archive (1991-1998)
We've discussed problem with max() function with friends and we think that
SQL syntax should be extended:
There should be 'IS MAX' clause in WHERE section, similarly to 'IS NULL'
clause.
For example:
select rowid from table where col is max
Why?
Today, MAX() is treated like SUM() or COUNT(). But there is a big difference
between them: SUM() and COUNT() are features of whole column of table.
MAX() is feature of column, but it's also a feature of a row!
You can pick rows with max (or min of course) value. Of course it's
nonsense with SUM() or COUNT().
That's the difference.
What do you think about it, Informix people?
Michal Hobot
doctorq@sam.nask.com.pl