但是資料分存不同表格且無相關聯。
單純是列印出來而已。
例如
==========================
CPU | HDD | OS | ||||
C2QQ8200 | D1500GB7.2KS | DOS | ||||
A64X25050e | D150GB10KS | FreeDOS | ||||
A64X250940 | D160GB7.2KS | LinuxCM | ||||
A64X244940 | D200GB7.2KS | LinuxXW | ||||
A64X246940 | MCE | |||||
A64X24850e | ||||||
A64X248940 | ||||||
A64X25050e | ||||||
A64X250940 |
一般join會是相乘的結果,
要像上面這樣顯示,
需要使用rownum來關聯。
WITH
TA AS (
SELECT ROWNUM AS R, CPU FROM (SELECT DISTINCT CPU FROM TABLE_A ORDER BY CPU)
),
TB AS (
SELECT ROWNUM AS R, HDD FROM (SELECT DISTINCT HDD FROM TABLE_B ORDER BY HDD)
)
SELECT TA.*, TB.*
FROM TA
FULL OUTER JOIN TB
ON TA.R = TB.R
ORDER BY 1;