count(decode(a.c_rybh,b.c_rybh,decode(b.C_LDLB,'10',1,'11',1,'12',1,'13',1,'16',1,'19',1)))

解决方案 »

  1.   

    谢谢楼上,但是有些语句的取值非常复杂,这样写好像不合适,例如:
    (case when a.C_ZWJB in ('04','06','08','10') then '0'+to_char(to_number(a.C_ZWJB) - 1) else a.C_ZWJB end)
      

  2.   

    decode(a.C_ZWJB, 
    '04', '0' || to_char(to_number(a.C_ZWJB) - 1), 
    '06', '0' || to_char(to_number(a.C_ZWJB) - 1), 
    '08', '0' || to_char(to_number(a.C_ZWJB) - 1), 
    '10', '0' || to_char(to_number(a.C_ZWJB) - 1),
    a.C_ZWJB)
      

  3.   

    count(decode(case when b.n_gl>5 and b.n_gl<11   then 1 end ))
    这个语句怎么转呀?