By using db<>fiddle, you agree to license everything you submit by Creative Commons CC0.
WITH ALL_DATA AS
(SELECT *
FROM (VALUES 1, 2) A (I)
)
SELECT I
FROM
(
SELECT B.*, ROW_NUMBER () OVER () AS RN_
FROM (VALUES 1, 2, 3) B (I)
)
WHERE RN_ <= (SELECT COUNT(*) FROM ALL_DATA)
I |
---|
1 |
2 |