Subject Re: [firebird-support] Problem with FIRST in where clause
Author Sándor Tamás (HostWare Kft)
Why don't you use

Select first 50 *
from MEET
order by LASTCHANGED, ENDDATE

SanTa

----- Original Message -----
From: Christian Kaufmann
To: firebird-support@yahoogroups.com
Sent: Thursday, August 31, 2006 11:35 AM
Subject: [firebird-support] Problem with FIRST in where clause


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?

Also the plan is not perfect:

PLAN (MEET ORDER IX_MEET_LASTCHANGED)
PLAN (MEET NATURAL)

IX_MEET_LASTCHANGED is a descending index on LASTCHANGED

cu Christian





[Non-text portions of this message have been removed]