Subject RE: [firebird-support] Re: whats the opposite of first?
Author Nigel Weeks
Looks a bit like a subselect. I'll have a tinker.


-----Original Message-----
[]On Behalf Of Adam
Sent: Wednesday, 18 October 2006 12:40 PM
Subject: [firebird-support] Re: whats the opposite of first?

> Any chance of a quick tutorial on using them?

It is just a query pretending to be a table; a bit like a temporary
view only available to the current query.

1. Write a query.
2. Put brackets around it.
3. Use it in your other query just like any other table of view.

In my example for the OP I used a stored procedure because it is
available in FB 1.5 and derived tables are not. I believe it would be
possible to do it under FB 2, something like:

select id
from (select first 5 id from mytable order by 1 desc)
order by 1 desc

Untested and probably OT and for this list ;(


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