多余的table影响了我的结果
select distinct 'CSP','PU4','BOI',a.line,a.cust_model,'20061009','D',substring(c.comp_format,5,2),
count(case when a.errcode='PASS' and a.station='FFT' then a.serial_number else null end) as PassQty,
count(case when a.station='CSP'then a.serial_number else null end) as CSPQty
from pqc a,[172.26.40.20].Report.dbo.FQA_Err_Information b,comp_format c
WHERE a.transdatetime between '20061009200000' and '20061010080000' and a.cust_model=c.qci_model and c.category='MB'
group by a.line,a.cust_model,substring(c.comp_format,5,2)
order by a.line ,a.cust_model,substring(c.comp_format,5,2)
我在计算count的时候,为什么comp_format起了作用,得到了不是我想要的结果
我要在这个table里面抓东西,又不能把这个table去掉
请教高手,如何解决?