哪位大侠可以帮我优化下以下SQL语句,这个查询出来有点慢,急。。谢谢!
SELECTZ5.BILLTYPEID,Z5.Num_,Z6.DEFAULTCAPTION,Z6.TFormName_ASFormName_FROM(SELECTZ2.B...
SELECT Z5.BILLTYPEID,Z5.Num_,Z6.DEFAULTCAPTION,Z6.TFormName_ AS FormName_
FROM (
SELECT Z2.BILLTYPEID,COUNT(Z2.BILLNUMBER) AS Num_ FROM (
SELECT DISTINCT Z1.BILLTYPEID,Z1.BILLNUMBER FROM (
SELECT D.ORDERFORM_MID,D.BILLIT,D.BILLTYPEID,D.BILLNUMBER,D.BILLDATE,D.Flag,D.DeptCode_ FROM WorkFlowLog AS D
WHERE NOT Exists (Select ORDERFORM_MID,BILLIT,BILLTYPEID,BILLNUMBER,BILLDATE,Flag,DeptCode_ FROM WorkFlowLog AS E
WHERE D.ORDERFORM_MID=E.ORDERFORM_MID AND D.BILLTYPEID=E.BILLTYPEID AND D.BILLNUMBER=E.BILLNUMBER AND D.BILLIT<E.BILLIT
AND coalesce(D.DeptCode_,'')=coalesce(E.DeptCode_,'') )
AND coalesce(D.Type_,'')<>'comfirm'
) AS Z1
INNER JOIN ( SELECT * FROM AuditFlow WHERE coalesce(Type_,'') <>'SendMail' AND Trim(STATUS_)='1') AS Z
ON Z1.BILLTYPEID=Z.TB_ AND coalesce(Z1.Flag,0)=coalesce(Z.Level_,0)-1 AND coalesce(Z.DeptCode_,'')=coalesce(Z1.DeptCode_,'') AND coalesce(Z.Type_,'') NOT IN ('SendMail') AND Z.EmployeeID_='8909997'
) AS Z2 Group By Z2.BILLTYPEID
) AS Z5
LEFT OUTER JOIN Tmenulist AS Z6 ON Z5.BILLTYPEID=Z6.FormID
ORDER BY Z5.BILLTYPEID 展开
FROM (
SELECT Z2.BILLTYPEID,COUNT(Z2.BILLNUMBER) AS Num_ FROM (
SELECT DISTINCT Z1.BILLTYPEID,Z1.BILLNUMBER FROM (
SELECT D.ORDERFORM_MID,D.BILLIT,D.BILLTYPEID,D.BILLNUMBER,D.BILLDATE,D.Flag,D.DeptCode_ FROM WorkFlowLog AS D
WHERE NOT Exists (Select ORDERFORM_MID,BILLIT,BILLTYPEID,BILLNUMBER,BILLDATE,Flag,DeptCode_ FROM WorkFlowLog AS E
WHERE D.ORDERFORM_MID=E.ORDERFORM_MID AND D.BILLTYPEID=E.BILLTYPEID AND D.BILLNUMBER=E.BILLNUMBER AND D.BILLIT<E.BILLIT
AND coalesce(D.DeptCode_,'')=coalesce(E.DeptCode_,'') )
AND coalesce(D.Type_,'')<>'comfirm'
) AS Z1
INNER JOIN ( SELECT * FROM AuditFlow WHERE coalesce(Type_,'') <>'SendMail' AND Trim(STATUS_)='1') AS Z
ON Z1.BILLTYPEID=Z.TB_ AND coalesce(Z1.Flag,0)=coalesce(Z.Level_,0)-1 AND coalesce(Z.DeptCode_,'')=coalesce(Z1.DeptCode_,'') AND coalesce(Z.Type_,'') NOT IN ('SendMail') AND Z.EmployeeID_='8909997'
) AS Z2 Group By Z2.BILLTYPEID
) AS Z5
LEFT OUTER JOIN Tmenulist AS Z6 ON Z5.BILLTYPEID=Z6.FormID
ORDER BY Z5.BILLTYPEID 展开
1个回答
柚鸥ASO
2024-03-16 广告
2024-03-16 广告
ASO优化关键词可以从以下几个方面进行查看:1. 关键词覆盖方案效果:初始排名和关键词覆盖是判断效果优良的两个指标。2. 关键词排名优化效果:难易程度是重要的因素,有些词投放很小量级就可以排名进入TOP10,但有些词投放很大也不会有什么提升...
点击进入详情页
本回答由柚鸥ASO提供
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询