SELECT SUM(A+B+C) AS total, SUM(A) AS A,SUM(B) AS B,SUM(C) AS C FROM ( SELECT * FROM customer ) ss PIVOT ( COUNT(cust_id) FOR cust_category in(A,B,C) ) as pvt
select (select count(*) from customer )as TotalCustomer , (select COUNT(*) from customer where cus_category='A')as A , (select COUNT(*) from customer where cus_category='B')as B , (select COUNT(*) from customer where cus_category='C') as C
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)