在thisquery中我想显示特定的cl_id订单明细和ammount
select
distinct dbo.CLOI_ClientOrderItems.cl_id,
count(dbo.IN_Invoices.MasterOrderId) as Orders,
OverallTotal = (select
sum(in_total)
from IN_Invoices
where datepart(mm,in_date_issued)=1 and
datepart(yyyy,in_date_issued)=2014)
from IN_Invoices
inner join CLOI_ClientOrderItems on
IN_Invoices.MasterOrderId=CLOI_ClientOrderItems.MasterOrderId
where CLOI_ClientOrderItems.cl_id='100000_Pri'
group by cl_id