SELECT m_model,count(m_model),decode(max(m_sendshop),'中华营业厅',1,0)),
  ......

解决方案 »

  1.   

    SELECT m_model,count(m_model),sum(decode(m_sendshop,'中华营业厅',1,0)),sum(decode(m_sendshop,'省公司营业厅',1,0)),sum(decode(m_sendshop,'小北营业厅',1,0)) FROM zypt_mobile group by m_model;
      

  2.   

    if(m_sendshop='中华营业厅',1,0)这个格式oracle是不认识的,这个属于ms的,decode函数就是说明当字段值为多少的时候用其他值来代替显示,这个功能比if(con,ture,false)强多了,不用连续嵌套