题解 | #列出供应商及其可供产品的数量#
列出供应商及其可供产品的数量
https://www.nowcoder.com/practice/17f22851cf204019b51a36761a3afc79
select a.vend_id,count(prod_id) from Vendors a
left join Products b on a.vend_id=b.vend_id
group by vend_id
union
select c.vend_id,count(prod_id) from Vendors c
right join Products d on c.vend_id=d.vend_id
where d.vend_id is null
group by vend_id
order by vend_id