mysql没有Outter Join?

列出供应商及其可供产品的数量

http://www.nowcoder.com/practice/17f22851cf204019b51a36761a3afc79

之前有一题说要用outter join

其实left和right join都属于outer join

且根据题目的描述,这里并不适合使用全连接(使用左连接,结果如下)

select Vendors.vend_id as vend_id, count(Products.prod_id) as prod_id
from Vendors 
left join Products
on Vendors.vend_id = Products.vend_id
group by Vendors.vend_id
order by Vendors.vend_id
全部评论

相关推荐

水墨不写bug:疑似没有上过大学
点赞 评论 收藏
分享
吴offer选手:下午mt一来就告警说项目来不及,估计明天拿了权限就要参与开发了 已老实
实习生的蛐蛐区
点赞 评论 收藏
分享
评论
1
收藏
分享

创作者周榜

更多
牛客网
牛客网在线编程
牛客网题解
牛客企业服务