解决方案 »

  1.   

    where et.EMAILTYPENAME=decode(u.JOURNALID ,'204','post','get')
      

  2.   

    不太明白楼主为什么要限制u.JOURNALID,如果只想单纯的知道T_mail中出现的type类型的次数,可以尝试把count(*)改成count(distinct dt.emailtypeid)试试
      

  3.   

    1# 正解。运用decode()判断,类似于java的无限三目运算符。
    decode(u.JOURNALID ,'204','post','get')  
    -- 解释为: if u.JOURNALID='204' then 'post' else 'get' end if;可以网上搜索下decode的各种运用。
      

  4.   

    使用子查询,case when试试