繰り返しの性質を減らすために、このコードを要約する方法を誰か提案してください。どうもありがとう
select case
when c=1 and cs=1 and f=0 and fs=0 then 'FPL02'
when c=0 and cs=0 and f=1 and fs=1 then 'FPL03'
when c=1 and cs=0 and f=0 and fs=0 then 'FPL04'
when c=0 and cs=0 and f=1 and fs=0 then 'FPL05'
when c=1 and cs=1 and f=1 and fs=1 then 'FPL06'
when c=1 and cs=1 and f=1 and fs=0 then 'FPL07'
when c=1 and cs=0 and f=1 and fs=1 then 'FPL08'
when c=1 and cs=0 and f=1 and fs=0 then 'FPL09'
when Ab=1 then 'FPL10'
when cpc=1 and plo=0 then 'FPC01'
when cpc=0 and plo=1 then 'FPC02'
when cpc=1 and plo=1 then 'FPC03'
else 'FPL01' end
from (select ptmatter, BillLHAbsolute as Ab, BillLHChildren as C, BillLHChildrenSettle as CS, BillLHFinances as F, BillLHFinancesSettle as FS, BillLHCPC as CPC, BillLHPLO as PLO from MatterDataDef) as mmd
where ptmatter=$matter$