易飞-录入订单变更单-COPTC-03

1、原开窗语句

Select distinct TC001,TC002,TC003,TC004,MA002,TC012,TC005,TC006 
   from  COPTC
  inner join  COPTD ON TD001=TC001 AND TD002=TC002 AND TD016='N'
  Left join CMSMQ on TC001=MQ001 
  Left join CMSMU on MQ001=MU001 and MQ003=MU002
  LEFT JOIN COPMA ON TC004=MA001
  Where  TC027='Y' and  (( MU003='wuhy' and MQ029='Y' )  or MQ029='N' )
  AND   TC050 IN ('Y','N','n')

2、修改后开窗语句

    SELECT TOP 100 TC001,TC002,TC003,TC004,MA002,TC012,TC005,TC006 
    FROM $$COPTC AS COPTC LEFT JOIN $$COPMA AS COPMA ON TC004=MA001
    Left join $$CMSMQ AS CMSMQ on TC001=MQ001 
Left join $$CMSMU AS CMSMU on MQ001=MU001 and MQ003=MU002
    WHERE TC027='Y' AND (( MU003='wuhy' and MQ029='Y' )  or MQ029='N' )
    AND   TC050 IN ('Y','N','n')
AND EXISTS (SELECT TD001,TD002 FROM $$COPTD WHERE TC001=TD001 AND TC002=TD002 AND TD016='N')

评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值