考虑下表
Name Null? Type
----------------------------------------- -------- --------------
PRODID NUMBER
PRODNAME VARCHAR2(50)
Name Null? Type
----------------------------------------- -------- --------------
PRODID NUMBER
PROPID NUMBER
PRONAME VARCHAR2(100)
PROVALUE VARCHAR2(100)
样本数据如下
select * from prodmas;
PRODID PRODNAME
---------- --------------
101 Surf
102 Ariel
select * from prodprop
/
PRODID PROPID PRONAME PROVALUE
------ ---------- -----------------------------------------------
101 1001 Price 100
101 1002 color Blue
101 1003 Agent AV
102 1001 Price 95
102 1002 Color Orange
.....
像这样的普通连接查询
select prodname,provalue
from prodmas pm
inner join prodprop pp
on pm.prodid = pp.prodid
/
PRODNAME PROVALUE
-------------------------------------------------- -----------
Surf 100
Surf Blue
Surf AV
Ariel 95
Ariel Orange
但是预期的输出应该是这样的
Surf 100 Blue AV
Ariel 95 Orange AV
.......
希望我更清楚