All pastes #495041 Raw Edit

Mine

public text v1 · immutable
·published 2007-05-18 15:07 UTC
rendered paste body
desc SELECT '20070517' as date, CASE WHEN msc='huaw' then 'huawei' else msc END AS msc, COUNT(DISTINCT CASE WHEN qt_moc>0 OR qt_mtc>0 or qt_cfw_no_vms > 0 THEN servedmsisdn END), COUNT(DISTINCT CASE WHEN qt_mocSMS>0 OR qt_mtcSMS> 0 THEN servedmsisdn END), COUNT(DISTINCT CASE WHEN qt_moc>0 OR qt_mtc>0 OR qt_cfw_no_vms > 0 OR qt_mocSMS>0 OR qt_mtcSMS>0 THEN servedmsisdn END) FROM top_moc as t WHERE date between '2007-04-17' and '2007-05-17' GROUP BY 1,2\G
*************************** 1. row ***************************
           id: 1
  select_type: SIMPLE
        table: t
         type: ALL
possible_keys: ix_top_moc_date,ix_top_moc_datemsisdn
          key: NULL
      key_len: NULL
          ref: NULL
         rows: 101931964
        Extra: Using where; Using filesort