Subject Re: Problem with FIRST in where clause
Author Adam
--- In firebird-support@yahoogroups.com, "Christian Kaufmann"
<ch.kaufmann@...> wrote:
>
> The following query should find the last 50 meets, that where recently
> changed and should sort the result by the date of the meet:
>
> select * from MEET
> where MEETID in (select first 50 MEETID from MEET order by LASTCHANGED
> desc)
> order by ENDDATE
>
> When I run this query, I get all records of my table MEET. Can
> somebody tell me, what goes wrong?
>

First n doesn't work properly in a subquery.

You may be able to get what you want using a selectable stored procedure.

Adam