求中间文件的排序法 
 (case
         when substr(AAA.収入日, 4, 6) IN ('01', '02', '03')
     then
          to_char(add_months(to_char(AAA.収入日, 'yyyymmdd'), -12),'yyyy')
         when substr(AAA.収入日, 4, 6) IN ('04', '05')
 then
          case
          when substr(BBB.修改日, 0, 4) =
               substr(BBB.収入日, 0, 4) 
then
           substr(BBB.収入日, 0, 4)
          else
           to_char(add_months(to_char(BBB.収入日, 'yyyymmdd'), -12), 'yyyy')
       end 
else substr(BBB.収入日, 0, 4) 
end) AS 年度
   instr(01, AAA.bbb) > 0
不懂