select 'BX',sum(t.waterid) Cumulative_Idle_Time_Summary from userhouse t
where t.userid = '2e79da51-a9dd-4f08-ad30-80aca24d97d3'
AND t.houseid = '1'
UNION all
select 'BY',sum(t.electid) from userhouse t where t.userid = '2e79da51-a9dd-4f08-ad30-80aca24d97d3'
AND t.houseid = '1'
UNION all
select 'BZ',sum(t.gasid) from userhouse t where t.userid = '2e79da51-a9dd-4f08-ad30-80aca24d97d3'
AND t.houseid = '1'
where t.userid = '2e79da51-a9dd-4f08-ad30-80aca24d97d3'
AND t.houseid = '1'
UNION all
select 'BY',sum(t.electid) from userhouse t where t.userid = '2e79da51-a9dd-4f08-ad30-80aca24d97d3'
AND t.houseid = '1'
UNION all
select 'BZ',sum(t.gasid) from userhouse t where t.userid = '2e79da51-a9dd-4f08-ad30-80aca24d97d3'
AND t.houseid = '1'