解决方案 »
- Windows AD认证网站为什么有的用户能正常登陆,有的缺直接报错
- 上传图片附件时就出现"无效的图片文件"
- 求一统计SQL语句
- 很有意思的题:判断字符串是否符合要求,求助高手
- 讨论:对中小软件企业 .NET 开发比较JAVA更有前途?
- 得到1个数据集,如果把数据集中的第一行数据给个datalist绑顶,那现在想把剩下的数据也能绑顶,有什么办法啊?
- 三层架构 文件上传
- HTTP POST 如何发出如下这样的xml请求?
- 如何在B/S结构上实现接收连在客户端串口的设备传过来的数据并进行处理?
- ASP.NET毕业设计的问题,请大家帮忙解决下,谢谢了。
- 保持session
- .NET网站放在服务器上出现安全策略的问题,求解
select d.id
from ordd d
join Invh b on d.InvNum = b.InvNum
where b.Period = '201405' --发票月份
and (isnull(d.invnum,'')<>'' or d.Qty1<0) and d.LPNum<>'NOLP' --发票不为空,如果发票为空,必须QTY1为负数,即为退货。且Lpnum不等于’NOLP‘
and (isnull(d.lpnum,'')<>'' or d.Qty1<0) ----Lpnum不为空,如果Lpnum为空,必须QTY1为负数,即为退货
)id是key,其他以此类推
delete from ordd
from ordd d
join Invh b on d.InvNum = b.InvNum
where b.Period = '201405' --发票月份
and (isnull(d.invnum,'')<>'' or d.Qty1<0) and d.LPNum<>'NOLP' --发票不为空,如果发票为空,必须QTY1为负数,即为退货。且Lpnum不等于’NOLP‘
and (isnull(d.lpnum,'')<>'' or d.Qty1<0) ----Lpnum不为空,如果Lpnum为空,必须QTY1为负数,即为退货
---ordd
select d.id
from ordd d
join Invh b on d.InvNum = b.InvNum
where b.Period = '201405' --发票月份
and (isnull(d.invnum,'')<>'' or d.Qty1<0) and d.LPNum<>'NOLP' --发票不为空,如果发票为空,必须QTY1为负数,即为退货。且Lpnum不等于’NOLP‘
and (isnull(d.lpnum,'')<>'' or d.Qty1<0) ----Lpnum不为空,如果Lpnum为空,必须QTY1为负数,即为退货
)
delete LP where ID in (
select ID
from LP l
join
(select d.lpnum from ordd d
left join ordh h on d.SONum = h.SONum
left join invh i on d.InvNum=i.InvNum
where Period = '201405' --发票月份
and (isnull(d.lpnum,'')<>'' or d.Qty1<0) ----Lpnum不为空,如果Lpnum为空,必须QTY1为负数,即为退货
and (isnull(d.invnum,'')<>'' or d.Qty1<0) and d.LPNum<>'NOLP' --发票不为空,如果发票为空,必须QTY1为负数,即为退货。且Lpnum不等于’NOLP‘
group by d.lpnum
)d on l.LPNum = d.LPNum) --lpdelete ordh where ID in (
select ID from ordh h
right join
(select d.sonum from ordd d
left join Invh i on d.InvNum = i.InvNum
where i.Period = '201405' --发票月份
and (isnull(d.invnum,'')<>'' or d.Qty1<0) and d.LPNum<>'NOLP' --发票不为空,如果发票为空,必须QTY1为负数,即为退货。且Lpnum不等于’NOLP‘
and (isnull(d.lpnum,'')<>'' or d.Qty1<0) ----Lpnum不为空,如果Lpnum为空,必须QTY1为负数,即为退货
group by d.sonum )
d on h.SONum = d.SONum) --ordh
delete ordd where ID in
(select ID
from ordd d
join Invh b on d.InvNum = b.InvNum
where b.Period = '201405' --发票月份
and (isnull(d.invnum,'')<>'' or d.Qty1<0) and d.LPNum<>'NOLP' --发票不为空,如果发票为空,必须QTY1为负数,即为退货。且Lpnum不等于’NOLP‘
and (isnull(d.lpnum,'')<>'' or d.Qty1<0) ----Lpnum不为空,如果Lpnum为空,必须QTY1为负数,即为退货
---ordd
)delete Shipment where ID in (
select ID from Shipment s
left join invh i on i.ShpNum = s.ShpNum
where i.Period = '201405') --发票月份
--shipmentdelete from invh where Period = '201405' --发票月份