Subject | Re: [firebird-support] top n of "select" ed result |
---|---|
Author | Helen Borrie |
Post date | 2004-11-02T03:19:50Z |
At 10:33 AM 2/11/2004 +0800, you wrote:
SALESMAN, SALES_QTY
FROM EMPLOYEE
ORDER BY 2 DESC
It doesn't make sense to do a top/first query without an order by -
otherwise the question is "first of what?"
To skip the first 10 and get the next 10:
SELECT FIRST 10 SKIP 10
SALESMAN, SALES_QTY
FROM EMPLOYEE
ORDER BY 2 DESC
./hb
>HiSELECT FIRST 10
>
>How do I have FB return ONLY the top 10 or top n of a select result.
>
>Perhaps that should be re-phrased as how do I have FB do something like...
>
>select TOP(10) salesman, sales_qty from employee?
SALESMAN, SALES_QTY
FROM EMPLOYEE
ORDER BY 2 DESC
It doesn't make sense to do a top/first query without an order by -
otherwise the question is "first of what?"
To skip the first 10 and get the next 10:
SELECT FIRST 10 SKIP 10
SALESMAN, SALES_QTY
FROM EMPLOYEE
ORDER BY 2 DESC
./hb