場(chǎng)景:當(dāng)物料表的分組前臺(tái)跟后臺(tái)不一樣的情況或是前臺(tái)刪除分組提示有明細(xì)數(shù)據(jù)時(shí);
成都創(chuàng)新互聯(lián)公司主營(yíng)永安網(wǎng)站建設(shè)的網(wǎng)絡(luò)公司,主營(yíng)網(wǎng)站建設(shè)方案,重慶APP開發(fā)公司,永安h5小程序制作搭建,永安網(wǎng)站營(yíng)銷推廣歡迎永安等地區(qū)企業(yè)咨詢
一、查詢出分組對(duì)應(yīng)的fid;
select * from T_BD_MATERIALGROUP_L where fname like '%000%'
二、找出對(duì)應(yīng)的物料fnumber;
select a.fnumber from T_BD_MATERIAL a
left join (select fid,fname From T_BD_MATERIALGROUP_L ) t4 on a.FMATERIALGROUP=t4.fid
where t4.fname like '%000%' and FMATERIALGROUP=16416826
三、更新;
update a set a.FMATERIALGROUP=12258320 from T_BD_MATERIAL a
left join (select fid,fname From T_BD_MATERIALGROUP_L ) t4 on a.FMATERIALGROUP=t4.fid
where t4.fname like '%000%' and FMATERIALGROUP=16416826