select exgno,producttype,
case when exgno like '01%' and producttype='1' then 'A'
when exgno like '01%' and producttype='2' then 'B'
when exgno not like '01%' and producttype='1' then 'C'
when exgno not like '01%' and producttype='2' then 'D'
end as XM
from BOM
case when exgno like '01%' and producttype='1' then 'A'
when exgno like '01%' and producttype='2' then 'B'
when exgno not like '01%' and producttype='1' then 'C'
when exgno not like '01%' and producttype='2' then 'D'
end as XM
from BOM
case when exgno like '01%' then decode(producttype,'1','A', 'B')
else decode(producttype,'1','C', 'D')
end as XM
from BOM
就是decode函数和C里面的?:功能差不多的是吧?
好像在9i以后才能用