select 
--WorkSet.WorkSetID as RouteNo,

max(case  Meter.MeterCategory
when 0 then 'Electric'
when 4 then 'Water'
when 1 then 'Gas'
end ) as 'MeterType',
max(case MeterSessionInput.ReadMethod
when 0 then 'Keyed'
when 3 then 'RF'
end ) as 'ReadMethod',
count(*) as Count
from MeterSessionInput
left join Meter on MeterSessionInput.MeterKey = Meter.MeterKey
left join Customer on Meter.CustomerKey = Customer.CustomerKey
left join MeterSessionInputRF on MeterSessionInput.MeterSessionInputKey  = MeterSessionInputRF.MeterSessionInputKey
left join MeterSessionOutput on MeterSessionOutput.MeterSessionInputKey = MeterSessionInput.MeterSessionInputKey
left join MeterSessionOutputRF on MeterSessionOutputRF.MeterSessionOutputKey = MeterSessionOutput.MeterSessionOutputKey 
left join WorkSet on Customer.WorkSetKey = WorkSet.WorkSetKey
left join GPSInformation on Meter.MeterKey = GPSInformation.MeterKey

group by -- WorkSet.WorkSetID,
MeterSessionInput.ReadMethod, Meter.MeterCategory
order by -- WorkSet.WorkSetID, 
Meter.MeterCategory, MeterSessionInput.ReadMethod
