Hi
i am curious if
1.
SELECT
FROM
TABLE_X X
ROWS 2
is equal to
2.
SELECT
FROM
(
SELECT
FROM
TABLE_X X
) Y
ROWS 2
or maybe it is
3.
SELECT
FROM
(
SELECT
FROM
TABLE_X X
ROWS 2
) Y
And is it always one of these cases, regardless of the query plan?
I’m fairly sure the answer is “2,” but I need to be certain.
To make the question a bit more complex, consider different LIMIT-style clauses:
a) rows:
SELECT
FROM
TABLE_X X
ROWS 2
b) first:
SELECT
FROM
TABLE_X X
c) fetch:
SELECT
FROM
TABLE_X X
FETCH FIRST 2 ROWS ONLY
regards,
Karol Bieniaszewski