Subject | Re: [firebird-support] Re: Highest and Second highest values |
---|---|
Author | David Johnson |
Post date | 2006-03-24T03:22:29Z |
I take that back ... vanilla SQL doesn't handle that well. Firebird SQL
supports the FIRST predicate, so I'm barking up a tree.
supports the FIRST predicate, so I'm barking up a tree.
On Fri, 2006-03-24 at 03:11 +0000, Adam wrote:
> > Is it possible to select both the max and next max value in a table
> using
> > dsql? Ie the 2 highest values in a tables column.
>
> Easy.
>
> select first 2 *
> from mytable
> order by myvalue desc
>
> A descending index on myvalue is useful if the table is large.
>
>
> Adam