[selectRecords] select (case when(syori_ymd != '')then(to_char(to_date(syori_ymd, 'YYYYMMDD'), 'yyyy/mm/dd'))else('')end) as syori_ymd ,(case when (&19 = 0) then null else (case suryo when 0 then 0 else (genka_gaku / suryo) end) end)as gen_tanka ,(case when (&19 = 0) then null else (kingaku - genka_gaku) end) as arari ,v.* from( select th.den_no ,th.syori_ymd ,th.tok_cd ,th.tok_nm ,th.eigyou_tan_cd ,th.nonyu_no ,replace(replace(th.nonyu_nm,chr(13)||chr(10),chr(10)),chr(10),chr(13)||chr(10)) as nonyu_nm ,tm.hin_cd ,tm.hin_nm ,tm.tani ,tm.row_no ,coalesce(tm.suryo,0) as suryo ,coalesce(tm.tanka,0) as tanka ,coalesce(tm.kingaku,0) as kingaku ,coalesce(tm.genka_gaku,0) as genka_gaku ,tm.meisai_biko ,tk.keisyo ,hin.hin_nm as hin_nm_m ,han.han_name as state ,tan.tan_nm from t_uri_m tm inner join t_uri th on tm.den_no = th.den_no left join m_tokui tk on tk.tok_cd = th.tok_cd left join m_hanyo han on (th.prc_sts = han.han_cd and mst_kbn = '01') left join m_tanto tan on (tan.tan_cd = th.eigyou_tan_cd) left join m_hin hin on (hin.hin_cd = tm.hin_cd) where 1 = 1 and th.del_flg = 0 and jucyu_flg = 0 and (tk.shime_dd = fnc_to_number('&2') or '' = '&2') --’÷“ú and (th.prc_sts = '&5' or '' = '&5') and (th.tok_cd >= '&6' or '' = '&6') and (th.tok_cd <= '&7' or '' = '&7') and (th.nonyu_no >= fnc_to_number('&8') or '' = '&8') and (th.nonyu_no <= fnc_to_number('&9') or '' = '&9') and (th.eigyou_tan_cd >= '&10' or '' = '&10') and (th.eigyou_tan_cd <= '&11' or '' = '&11') and (tm.hin_cd >= '&12' or '' = '&12') and (tm.hin_cd <= '&13' or '' = '&13') and (hin.cat_cd >= '&14' or '' = '&14') and (hin.cat_cd <= '&15' or '' = '&15') and (th.den_no >= fnc_to_number('&16') or '' = '&16') and (th.den_no <= fnc_to_number('&17') or '' = '&17') and ((fnc_translate_case(tm.hin_nm) LIKE '%'||fnc_translate_case('&18')||'%') or ('&18' = '')) and (th.syori_ymd >= '&3' or '' = '&3') and (th.syori_ymd <= '&4' or '' = '&4') )v --order by v.syori_ymd,v.den_no,v.row_no --order by v.tok_cd,v.syori_ymd,v.den_no,v.row_no --order by v.tok_cd,v.nonyu_no,v.syori_ymd,v.den_no,v.row_no --order by v.eigyou_tan_cd,v.syori_ymd,v.den_no,v.row_no order by v.hin_cd,v.syori_ymd,v.den_no,v.row_no ;