第一句改成:
select 
    t.nukifuryoc_1 a , 
    t.nukifuryoc_2 b ,  
    (case 
        when t.nukifuryoc_2 is not null 
            then decode(substr (t.nukifuryoc_2,1,1),'1','1','2','2','3','3','4')
        when t.nukifuryoc_2 is null 
            then (case 
                    when t.nukifuryoc_1 is not null 
                        then decode(substr(t.nukifuryoc_1,1,1),'1','1','2','2','3','3','4')
                    when t.nukifuryoc_2 is null 
                        then '0' 
                  end) 
     end)  nuki 
from 
    nyukentorihiki t 
Group By 
    t.nukifuryoc_1,t.nukifuryoc_2

解决方案 »

  1.   

    第一句改成:select 
        t.nukifuryoc_1 a , 
        t.nukifuryoc_2 b ,  
        (case 
            when t.nukifuryoc_2 is not null 
                then decode(substr (t.nukifuryoc_2,1,1),'1','1','2','2','3','3','4')
            when t.nukifuryoc_2 is null 
                then (case 
                        when t.nukifuryoc_1 is not null 
                            then decode(substr(t.nukifuryoc_1,1,1),'1','1','2','2','3','3','4')
                        when t.nukifuryoc_2 is null 
                            then '0' 
                      end) 
         end)  nuki 
    from 
        nyukentorihiki t 
    Group By
        t.nukifuryoc_1,t.nukifuryoc_2
      

  2.   

    libin_ftsafe(子陌红尘),兄弟,这边也混得不错啊,呵呵
      

  3.   

    group by 后出现的必须是前面相应表中的字段名,而不能是别名。