WITH tbl_a AS (
SELECT '1' AS code , '11' AS name
UNION ALL
SELECT '2' AS code , '22' AS name
UNION ALL
SELECT '3' AS code , '33' AS name
UNION ALL
SELECT '4' AS code , '44' AS name
UNION ALL
SELECT '5' AS code , '55' AS name
)
WITH tbl_b AS (
SELECT '6' AS code , '66' AS name
UNION ALL
SELECT '7' AS code , '77' AS name
UNION ALL
SELECT '8' AS code , '88' AS name
)
위처럼 두 테이블이 있다고 가정할때
결과값을 아래와같이 출력하려면 어떻게 쿼리를 만들어야할까요..
a_code |
a_name |
b_code |
b_name |
1 |
11 |
6 |
66 |
2 |
22 |
7 |
77 |
3 |
33 |
8 |
88 |
4 |
44 |
|
|
5 |
55 |
|
|
|