这个SQL语句为什么不能执行

wuqingyang2000 2003-09-10 05:12:36
select a.CustomerType,substr(T.FinalEndDate,1,7) as FinalEndDate,
a.DiameterInch,a.ProductType,a.ProductCode,count(a.LotNo) as LotNo,
sum(a.StandardQuantity) as StandardQuantity,sum(a.InputQuantity) as InputQuantity,
sum(a.SmetalLength) as SMetalLength,sum(a.SmetalWeight) as SMetalWeight,
sum(a.PassQuantity) as PassQuantity,a.ReportType,substr(a.FinalEndDate,1,7) as Final
from cpjRptTcLotPassRate a , cpjProduct P,
(select MorderId,FinalEndDate from cpjRptTcLotPassRate
where substr(FinalEndDate,1,7) in ('2003/09') and CustomerType='TCO') T
where a.ProductId = P.Id
and a.MorderId = T.MorderId
group By a.CustomerType,substr(T.FinalEndDate,1,7) ,
a.DiameterInch,a.ProductType,a.ProductCode,
a.ReportType,substr(a.FinalEndDate,1,7);

1.用到了一个临时表
2.执行时会产生死锁现象,在PB中执行没有响应。
...全文
22 1 打赏 收藏 转发到动态 举报
写回复
用AI写文章
1 条回复
切换为时间正序
请发表友善的回复…
发表回复
pjezwht2 2003-09-13
  • 打赏
  • 举报
回复
多表关联是有点慢,正常现象,耐心等:)建议在from 语句中,把返回记录少的表放在前面

3,490

社区成员

发帖
与我相关
我的任务
社区描述
Oracle 高级技术相关讨论专区
社区管理员
  • 高级技术社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

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