1 2 3 4 5
| select ch.chantier, sum(ch.expr1) as sommedeexpr1
from [SELECT Chantier1 as chantier, sum (IIf (isnull (chantier1) and isnull (chantier2),0, IIf(not isnull (chantier1) and not isnull (chantier2), 0.5,1))) as expr1 from chantier where chantier1 is not null group by chantier1
UNION all
select Chantier2 as chantier, sum (IIf (isnull (chantier1) and isnull (chantier2),0, IIf(not isnull (chantier1) and not isnull (chantier2), 0.5,1))) as expr1 from CHANTIER where chantier2 is not null group by chantier2] as ch
group by ch.chantier; |
Partager