Subject | Re: [firebird-support] Does FB allow ORDER BY in subselects? |
---|---|
Author | Helen Borrie |
Post date | 2004-02-20T23:35:58Z |
At 11:09 PM 20/02/2004 +0000, you wrote:
the Fb 2 development. Actually, your query wouldn't get the *last* 10 users
anyway.
SELECT FIRST 10 * FROM USERS
ORDER BY ACCESS DESC
A descending index on ACCESS is called for here.
/heLen
>Hi,Fb currently doesn't support SELECT .. FROM (SELECT...) at all. Coming in
>
>I have a table with usernames and times when they last accessed a
>system (a timestamp). I need to have the last 10 users to access the
>system in alphabetical order, so I figured I'd do something like
>
>SELECT * FROM (SELECT FIRST 10 USERNAME FROM USERS ORDER BY ACCESS
>DESC) ORDER BY USERNAME;
>
>but that didn't work. Is something like this possible at all?
the Fb 2 development. Actually, your query wouldn't get the *last* 10 users
anyway.
SELECT FIRST 10 * FROM USERS
ORDER BY ACCESS DESC
A descending index on ACCESS is called for here.
/heLen