没有合适的资源?快使用搜索试试~ 我知道了~
sql操作整理
资源推荐
资源详情
资源评论
添加零售店 经销商负责人根据门店走的
1.truncate tb_shop
2.4395
insert INTO tb_shop (shop_address_id ,shop_star_type ,shop_name,shop_specific_address,old_store_code,contacts_name,contacts_phone,contacts_telephone,open_id,pinpai_name,shop_time ,is_join ,shop_type,input_clerk_name,input_clerk_phone,input_shop_name ,input_shop_phone)
(select 经销商全称, (case 品牌 when '回力' then 2 when '双钱' then 1 when '万世达' then 3 else 4 end ) , 管辖零售店全称, 门店详细地址,门店代码,店主姓名,店主手机号,店主手机号 ,店主注册数 ,品牌,now(),1,2 ,下属销售业务员姓名,业务员手机号,经销商负责人,负责人手机号 from tb_register)
导入经销商表 127
insert INTO tb_shop ( shop_name,shop_time ,shop_type,input_sale_name,input_sale_phone)
(select DISTINCT(经销商全称), now(),1,销售代表姓名,销售代表手机号 from tb_register)
倒入经销商临时表
truncate tb_tem;
insert into tb_tem (shop_id ,shop_name)
(select id,shop_name from tb_shop where shop_type=1)
//更新店的经销商id
update tb_shop as t2 set superior_id =(SELECT shop_id from tb_tem as t1 where t1.shop_name=t2.shop_address_id ) where shop_type=2
//导入星店与品牌与经销商关联表
insert into tb_shop_related (shop_id,pinpai_name,shop_type,superior_id)(
select id ,'双钱',2, superior_id from tb_shop where shop_type =2 and shop_star_type>=4 and pinpai_name like'%双钱%')
insert into tb_shop_related (shop_id,pinpai_name,shop_type,superior_id)(
select id ,'回力',2, superior_id from tb_shop where shop_type =2 and shop_star_type>=4 and pinpai_name like'%回力%')
insert into tb_shop_related (shop_id,pinpai_name,shop_type,superior_id)(
1.truncate tb_shop
2.4395
insert INTO tb_shop (shop_address_id ,shop_star_type ,shop_name,shop_specific_address,old_store_code,contacts_name,contacts_phone,contacts_telephone,open_id,pinpai_name,shop_time ,is_join ,shop_type,input_clerk_name,input_clerk_phone,input_shop_name ,input_shop_phone)
(select 经销商全称, (case 品牌 when '回力' then 2 when '双钱' then 1 when '万世达' then 3 else 4 end ) , 管辖零售店全称, 门店详细地址,门店代码,店主姓名,店主手机号,店主手机号 ,店主注册数 ,品牌,now(),1,2 ,下属销售业务员姓名,业务员手机号,经销商负责人,负责人手机号 from tb_register)
导入经销商表 127
insert INTO tb_shop ( shop_name,shop_time ,shop_type,input_sale_name,input_sale_phone)
(select DISTINCT(经销商全称), now(),1,销售代表姓名,销售代表手机号 from tb_register)
倒入经销商临时表
truncate tb_tem;
insert into tb_tem (shop_id ,shop_name)
(select id,shop_name from tb_shop where shop_type=1)
//更新店的经销商id
update tb_shop as t2 set superior_id =(SELECT shop_id from tb_tem as t1 where t1.shop_name=t2.shop_address_id ) where shop_type=2
//导入星店与品牌与经销商关联表
insert into tb_shop_related (shop_id,pinpai_name,shop_type,superior_id)(
select id ,'双钱',2, superior_id from tb_shop where shop_type =2 and shop_star_type>=4 and pinpai_name like'%双钱%')
insert into tb_shop_related (shop_id,pinpai_name,shop_type,superior_id)(
select id ,'回力',2, superior_id from tb_shop where shop_type =2 and shop_star_type>=4 and pinpai_name like'%回力%')
insert into tb_shop_related (shop_id,pinpai_name,shop_type,superior_id)(
资源评论
qq_20960523
- 粉丝: 0
- 资源: 1
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功