#左外联结
SELECT *
from vendors
left join products
on vendors.ID=products.VID ;
# 右外链接
SELECT *
from vendors
RIGHT join products
on vendors.ID=products.VID ;
#同上
SELECT *
from products
left join vendors
on vendors.ID=products.VID ;
#内连接 join inner join
SELECT *
from vendors
join products
on vendors.ID=products.VID ;
SELECT *
from vendors
inner join products
on vendors.ID=products.VID ;
#三表连接
SELECT *
from vendors
left join products
on vendors.ID=products.VID
left join testtable
on products.ID=testtable.testID
SELECT *
from vendors
left join products
on vendors.ID=products.VID
left join testtable
on products.ID=testtable.testID
where vendors.name='供应商A'
select * from vendors left join products on vendors.ID=products.VID