SELECT TBL1.C1, TBL1.C2, TBL2.C3, TBL2.C4
FROM(
SELECT 100 C1, 'ABC' C2
UNION
SELECT 101 C1, 'XYZ' C2
UNION
SELECT 102 C1, 'PQR' C2
UNION
SELECT 103 C1, 'MNO' C2
) TBL1,
(
SELECT 1 C3, 'Saving Deposits' C4
UNION
SELECT 2 C3, 'Current Deposits' C4
UNION
SELECT 3 C3, 'Term Deposits' C4
)TBL2
上面的查询给出以下结果
--------------------------------------------
C1 | C2 |C3 | C4
--------------------------------------------
100 | ABC | 1 | Saving Deposits
101 | XYZ | 1 | Saving Deposits
100 | ABC | 2 | Current Deposits
101 | XYZ | 2 | Current Deposits
100 | ABC | 3 | Term Deposits
101 | XYZ | 3 | Term Deposits
但我期待如下结果
--------------------------------------------
C1 | C2 |C3 | C4
--------------------------------------------
100 | ABC | 1 | Saving Deposits
100 | ABC | 2 | Current Deposits
100 | ABC | 3 | Term Deposits
101 | XYZ | 1 | Saving Deposits
101 | XYZ | 2 | Current Deposits
101 | XYZ | 3 | Term Deposits
请帮我 ....