我有查询表,字段如下
sno confname region enquiry status update closed approval
1 Conf 2020 Madhya Pradesh test test closed reconsider
2 Conf 2013 Maharashtra test 123 abcde reconsider
3 Conf 2013 Maharashtra test12 test closed approved
4 Conf 2013 Maharashtra test124 test1 closed approved
5 Conf 3 Karnataka test124 test1
6 Conf 3 Karnataka test876 test45
7 Conf 3 Karnataka test365 test45 closed approved
我需要输出为
Region Conf Name Total No of Enq No of Enq Closed No of Enq Approved
Maharashtra Conf 2013 3 2 2
Karnataka Conf 3 3 1 1
Madhya Pradesh Conf 2020 1 1
我的 sql 查询是
SELECT confname,
region,
clsed ,
apprstatus ,
Count(region) AS totenq,
Count(clsed) AS totenqclsd ,
COUNT(apprstatus) AS totenqapproved
FROM [enquiries_dtls]
GROUP BY region,
confname,
clsed,
apprstatus