举例说明,A表(a1,b1,c1) B表(a2,b2)
左连接
select A.*,B.* from A left outer join B on(A.a1=B.a2)
结果是:
右连接:
select A.*,B.* from A right outer join B on(A.a1=B.a2)
结果是:
内连接:
SELECT * FROM a, b where a.a1=b.a2,这两种写法一样
结果是:
举例说明,A表(a1,b1,c1) B表(a2,b2)
左连接
select A.*,B.* from A left outer join B on(A.a1=B.a2)
结果是:
右连接:
select A.*,B.* from A right outer join B on(A.a1=B.a2)
结果是:
内连接:
SELECT * FROM a, b where a.a1=b.a2,这两种写法一样
结果是: