Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我想从计数结果中得到 AVG。
SELECT labelname AS Record_Labels, COUNT(title) AS Number_of_CDs_Released FROM CD JOIN RecordLabel ON labelname = released_by GROUP BY labelname;
我试过这样做:AVG(COUNT(title)),但它没有用。有谁可以帮我离开这里吗?
您可以使用嵌套查询来执行此操作:
select avg(Number_of_CDs_Released) from (SELECT labelname AS Record_Labels, COUNT(title) AS Number_of_CDs_Released FROM CD JOIN RecordLabel ON labelname = released_by GROUP BY labelname) nested;