标签: sql sql-server
有人可以检查这是否正确吗?
不确定我对问题6的回答是否正确,不确定我使用的group_by是否正确,其余的我认为还可以 谢谢
答案 0 :(得分:0)
您很近。您需要:
COUNT()
SUM()
HAVING
您的查询应类似于:
select a.author_id, count(*) as titles, sum(b.quantity_ordered) as units from a join b on a.book_id = b.book_id group by a.author_id