how can i count this 3 fields in mysql? -
case when epro02.startreportid = 101 , eventprovider02.startvoltage = 0 'power supply disconnected' when eventprovider02.startsatellitecount < 9 or eventprovider02.startgsmsignallevel < 20 or eventprovider02.startgsmstatus != 9 'network outage' when eventprovider02.startreportid = 13 'gsm jamming' end reason
use entire case...end
count()
, group by
select case when epro02.startreportid = 101 , eventprovider02.startvoltage = 0 'power supply disconnected' when eventprovider02.startsatellitecount < 9 or eventprovider02.startgsmsignallevel < 20 or eventprovider02.startgsmstatus != 9 'network outage' when eventprovider02.startreportid = 13 'gsm jamming' end reason, count(case when epro02.startreportid = 101 , eventprovider02.startvoltage = 0 'power supply disconnected' when eventprovider02.startsatellitecount < 9 or eventprovider02.startgsmsignallevel < 20 or eventprovider02.startgsmstatus != 9 'network outage' when eventprovider02.startreportid = 13 'gsm jamming' end) reason_count your_table_join_here group case when epro02.startreportid = 101 , eventprovider02.startvoltage = 0 'power supply disconnected' when eventprovider02.startsatellitecount < 9 or eventprovider02.startgsmsignallevel < 20 or eventprovider02.startgsmstatus != 9 'network outage' when eventprovider02.startreportid = 13 'gsm jamming' end
Comments
Post a Comment