INNER JOIN的笛卡尔积

时间:2018-10-26 07:23:14

标签: sql

SELECT A.x, A.y, B.m, B.n, C.p 
FROM A,B,C 
WHERE A.x = B.l 
  AND A.y = B.m 
  AND B.n = C.q

SELECT A.x, A.y, B.m, B.n, C.p 
FROM A 
 INNER JOIN B ON A.x = B.l AND A.y = B.m 
 INNER JOIN C ON B.n = C.q

给出笛卡尔积。我在哪里做错了?

1 个答案:

答案 0 :(得分:0)

仅在sql下使用,它将为您提供笛卡尔积

SELECT A.x, A.y, B.m, B.n, C.p FROM A,B,C