多余的table影响了我的结果

QMSKUMA 2006-10-10 10:46:04
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去掉
请教高手,如何解决?
...全文
73 2 打赏 收藏 转发到动态 举报
写回复
用AI写文章
2 条回复
切换为时间正序
请发表友善的回复…
发表回复
Eddie005 2006-10-18
  • 打赏
  • 举报
回复
顶顶~
playwarcraft 2006-10-10
  • 打赏
  • 举报
回复
......這裡又貼了一個.

22,209

社区成员

发帖
与我相关
我的任务
社区描述
MS-SQL Server 疑难问题
社区管理员
  • 疑难问题社区
  • 尘觉
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧