|
select fbin,
case when (substr(fbin,4,1)) in (1,3,5,7,9) and (substr(fbin,5,2)) in (1,2,3,4) then '1'
when (substr(fbin,4,1)) in (1,3,5,7,9) and (substr(fbin,5,2)) in (5,6,7,8,9,10,11,12) then '2'
when (substr(fbin,3,2)) in (2,4,6,8,10) and (substr(fbin,5,2)) in (1,2,3,4,5,6,7,8) then '1'
when (substr(fbin,3,2)) in (2,4,6,8,10) and (substr(fbin,5,2)) in (9,10,11,12) then '2'
end
from tpickupdtl
|