2个回答
2016-06-05
展开全部
SELECT T1.name,T1.buyAmount,T2.sellAmount FROM
(SELECT A.name,SUM(buyAmount) FROM A GROUP BY A.name) T1
LEFT JOIN
(SELECT B.name,SUM(sellAmount) FROM B GROUP BY B.name) T2
ON T1.name=T2.name
答案应该是这样子。先统计后联接
(SELECT A.name,SUM(buyAmount) FROM A GROUP BY A.name) T1
LEFT JOIN
(SELECT B.name,SUM(sellAmount) FROM B GROUP BY B.name) T2
ON T1.name=T2.name
答案应该是这样子。先统计后联接
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询