思迅商云系列按供应商查询流水有数据,销售报表无数据SQL语句

思迅商云系列按供应商查询流水有数据,销售报表无数据SQL语句

问题原因是商品转换新供应商时没有删除掉旧供应商对应关系导致,请备份数据库后执行以下语句重新生成商品与供应商对应关系表。

use hbposv8

--删除商品与供应商关系表
delete t_bd_supcust_item
go

--重新生成这部分商品与供应商关系表
insert into t_bd_supcust_item(item_no,branch_no,supcust_no,sale_way)
select item_no,(select sys_var_value from t_sys_system where sys_var_id like '%g_branch_no%') as branch_no,main_supcust,item_sup_flag from t_bd_item_info where not exists(select *  from t_bd_supcust_item where  (item_no =t_bd_item_info.item_no) and (supcust_no = t_bd_item_info.main_supcust) and  branch_no =(select sys_var_value from t_sys_system where sys_var_id like '%g_branch_no%' ))

--更新日汇总数据
update t_rm_daysum set supcust_no=t_bd_item_info.main_supcust from t_bd_item_info
where t_rm_daysum.item_no=t_bd_item_info.item_no
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值