网站首页 > 服务与支持 > 常见问题

药易通8系处理单据同步时,单据明细出现翻倍的情况

2017-05-24 09:51:20 岳阳诺尔软件科技有限公司 阅读

select*from PosPrice where price_id in (select min(price_id) from PosPrice group by p_id, u_id, unittype, Y_ID having count(p_id) > 1)--查询机构价格表重复

select*from Price where price_id in (select min(price_id) from Price group by p_id, u_id, unittype having count(p_id) > 1)--查询价格表重复

select*from price where p_id in(select product_id from products where price.p_id=product_id and unit1_id<>price.u_id  ) and unittype=1--查询单位不对的价格

select*from posprice where p_id in(select product_id from products where posprice.p_id=product_id and unit1_id<>posprice.u_id  ) and unittype=1--查询单位不对的价格






delete PosPrice where price_id in (select min(price_id) from PosPrice group by p_id, u_id, unittype, Y_ID having count(p_id) > 1)--删除机构价格表重复

delete Price where price_id in (select min(price_id) from Price group by p_id, u_id, unittype having count(p_id) > 1)--删除价格表重复

delete price where p_id in(select product_id from products where price.p_id=product_id and unit1_id<>price.u_id  ) and unittype=1--删除单位不对的价格

delete posprice where p_id in(select product_id from products where posprice.p_id=product_id and unit1_id<>posprice.u_id  ) and unittype=1--删除单位不对的价格




update a set u_id=b.unit1_id from price a,products b where a.p_id=b.product_id and a.unittype=1   --修改价格对就单位






岳阳诺尔软件科技有限公司 版权所有 2008-2014 湘ICP备12010268号