SELECT 'MEMBERS(ACTIVE ACCOUNTS)' particular, ''value
union all
SELECT +' '+ member_type,
(SELECT active_students = (SELECT COUNT(member_type_id) FROM LM_MEMBER_MASTER
WHERE institute_code = 'GDAB' AND member_type_id = A.member_type_id AND status = 'Active'))
FROM LM_MEMBER_TYPE_MASTER A WHERE institute_code = 'GDAB'
union all
Select ' Total' particular, COUNT(member_type_id) FROM LM_MEMBER_MASTER
WHERE institute_code = 'GDAB' AND status = 'Active'
union all
SELECT 'MEMBERS(CLOSED ACCOUNTS)' particular, '' value
union all
SELECT +' '+member_type,
(SELECT active_students = (SELECT COUNT(member_type_id) FROM LM_MEMBER_MASTER
WHERE institute_code = 'GDAB' AND member_type_id = A.member_type_id AND status = 'Closed'))
FROM LM_MEMBER_TYPE_MASTER A WHERE institute_code = 'GDAB'
union all
Select ' Total' particular, COUNT(member_type_id) FROM LM_MEMBER_MASTER
WHERE institute_code = 'GDAB' AND status = 'Closed'
in this code i dont want to count 'MEMBERS(ACTIVE ACCOUNTS)' and 'MEMBERS(CLOSED ACCOUNTS)' bcoz its headlines