码迷,mamicode.com
首页 > 数据库 > 详细

批量修改数据sql

时间:2016-04-18 18:37:54      阅读:199      评论:0      收藏:0      [点我收藏+]

标签:

 

 

--insert into P_ZPROMOTION_DOC_ITEMS (AKTNR,MATNR,MINGROSS,MCRANK,MCUPRICE,MAXBAKTNR,MAXBPAMONT,MAXBPRICE,MINBAKTNR,MINBPAMONT,MINBPRICE) SELECT AKTNR4,MATNR,MINGROSS,MCRANK,MCUPRICE,MAXBAKTNR,MAXBPAMONT,MAXBPRICE,MINBAKTNR,MINBPAMONT,MINBPRICE FROM P_ZPROMOTION_SOURCE WHERE AKTNR4=5075

select * from P_ZPROMOTION_DOC_ITEMS where AKTNR=‘BL5075‘ and len (matnr)>0 --448 select * from P_ZPROMOTION_SOURCE where AKTNR4=‘5075‘ and matnr in (select matnr from P_ZPROMOTION_DOC_ITEMS where AKTNR=‘BL5075‘)

--批量修改数据

update P_ZPROMOTION_DOC_ITEMS set MINGROSS=b.MINGROSS,MCRANK=b.MCRANK,MCUPRICE=b.MCUPRICE, MAXBAKTNR=b.MAXBAKTNR,MAXBPAMONT=b.MAXBPAMONT,MAXBPRICE=b.MAXBPRICE,MINBAKTNR=b.MINBAKTNR, MINBPAMONT=b.MINBPAMONT,MINBPRICE=b.MINBPRICE from P_ZPROMOTION_DOC_ITEMS a,P_ZPROMOTION_SOURCE b where a.AKTNR=‘BL5075‘ and b.AKTNR4=‘5075‘ and a.matnr=b.matnr

批量修改数据sql

标签:

原文地址:http://www.cnblogs.com/Carri/p/5405155.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!