mysql:多表,union,count,group by的问题,求教

select A.uid,count(*) from A GROUP by A.uid UNION all 
select A.uid,count(*) from A,B where B.neid = A.neid GROUP by A.uid UNION all 
select A.uid,count(*) from A,C where C.Type = 'student' and C.neid=A.neid GROUP by A.uid;

如果用每行语句单独查询,结果分别是这样的

阅读 3.6k
撰写回答
你尚未登录,登录后可以
  • 和开发者交流问题的细节
  • 关注并接收问题和回答的更新提醒
  • 参与内容的编辑和改进,让解决方法与时俱进
推荐问题