0

我有这些疑问:

SELECT COUNT(*) AS numofrows, disposition,region FROM total_disposition_report WHERE disposition='ANSWERED' GROUP BY region ;

SELECT COUNT(*) AS numofrows, disposition,region FROM total_disposition_report WHERE disposition='BUSY' GROUP BY region ;

SELECT COUNT(*) AS numofrows, disposition,region FROM total_disposition_report WHERE disposition='...' GROUP BY region ;

SELECT COUNT(*) AS numofrows, disposition,region FROM total_disposition_report WHERE disposition='...' GROUP BY region ;

top 是否有机会在一个查询中获得相同的效果?

4

2 回答 2

2

只需添加dispositiongroup by

例如:

SELECT COUNT(*) AS numofrows, disposition,region FROM total_disposition_report GROUP BY region, disposition;
于 2013-06-09T10:26:29.457 回答
1
SELECT COUNT(*) AS numofrows, disposition,region 
FROM total_disposition_report 
WHERE disposition IN ('ANSWERED', 'BUSY', '...') 
GROUP BY region, disposition ;
于 2013-06-09T10:24:32.060 回答