select Dept, CC, SUM(Actual) as 合计 from cActual where FiscalMonth<'P8' and FiscalYear='FY1314'
and FiscalMonth not in ('P7','P8') group by CC, Dept
这样?
select Dept, CC, SUM(Actual) as 合计
from cActual
where right(FiscalMonth,1)<'7'
and FiscalYear='FY1314'
group by CC, Dept