SELECT * FROM A;
A_ID A_NAME A_ADDRESS
---------- ---------- ----------
1 RAM MO
2 SITA MI
3 JANAKI IL
SELECT * FROM B;
A_ID B_NAME
---------- ----------
1 PAUL
1 KAPIL
2 DAVE
SELECT * FROM C;
B_NAME C_TITLE
---------- ----------
KAPIL HONDA
KAPIL MAZDA
KAPIL ODYSSY
DAVE BENZE
DAVE LIMOUSINE
SELECT a.A_ID, a.A_Name, a.A_Address, b.B_Name, Count(C_Title)
FROM A a
INNER JOIN B b ON(a.A_ID = b.A_ID)
INNER JOIN C c ON(b.B_Name=c.B_Name)
GROUP BY a.A_ID, a.A_Name, a.A_Address, b.B_Name;
A_ID A_NAME A_ADDRESS B_NAME COUNT(C_TITLE)
---------- ---------- ---------- ---------- --------------
2 SITA MI DAVE 2
1 RAM MO KAPIL 3
在这里,我认为表 C 中的 B_Name 具有信誉值(因为它是外键),并且 A 中的 A_ID、B 中的 B_Name 是主键。