从百度知道里看到的,记录下来以防忘记了
只查询前10行
fetch first 10 rows only
SELECT
SALE_DATE,
SUM(SALE_MONEY) AS SUM_MONEY
FROM
SALE_REPORT
GROUP BY
SALE_DATE
ORDER BY
SUM(SALE_MONEY) DESC
fetch first 10 rows only;
查询 11 - 20
(fetch first 20 rows only) fetch first 10 rows only
SELECT
top20.*
FROM
(
SELECT
SALE_DATE,
SUM(SALE_MONEY) AS SUM_MONEY
FROM
SALE_REPORT
GROUP BY
SALE_DATE
ORDER BY
SALE_DATE DESC
fetch first 20 rows only
) AS top20
ORDER BY
top20.SALE_DATE ASC
fetch first 10 rows only;