ORACLE CONNECT BY를 이용한 조회
SELECT LEVEL AS NO
FROM DUAL
CONNECT BY LEVEL <= 10;
PostgreSQL
1. 재귀쿼리를 이용한 방법
WITH RECURSIVE DUAL AS
(
SELECT 1 AS NO
UNION ALL
SELECT NO + 1
FROM DUAL
WHERE NO + 1 <= 10
)
SELECT NO
FROM DUAL;
2. GENERATE_SERIES를 이용한 방법
SELECT NO
FROM GENERATE_SERIES(1, 10) NO;
모든 결과는 아래와 같다.