34,587
社区成员
发帖
与我相关
我的任务
分享
[ANH_ID],[ANH_NORMTFrom],[ANH_NORMTTo]
INSERT INTO [T_PO_AdjustmentNORMTHeader]
(
,[ANH_NORMTFrom]
,[ANH_NORMTTo]
VALUES(1,'GX-15C/B3','GX-15C/B4'),(2,'Z387-08-02/A0','Z387-08-02/A1')(3,'J62-01/A4','J62-01/A5')
delete from tb where ANH_NORMT in ('GX-15C/B3','GX-15C/B4')
select t1.* from t_po_adjustmentnormtheader t1 join t_po_adjustmentnormtheader t2
on t2.anh_id=1 or t1.anh_normtfrom=t2.anh_normtto
delete from tb where exists (select 1 from T_PO_AdjustmentNORMTHeader a where tb. [ANH_NORMTFrom]=a. [ANH_NORMTFrom] and tb.[ANH_NORMTTo]=a.[ANH_NORMTTo] and a.[ANH_ID]=你需要的值)
delete from tb where ANH_NORMT in (select [ANH_NORMTFrom] from tb where ANH_ID=1 union select [ANH_NORMTTo] from tb where ANH_ID=1 )
delete from tb where ANH_NORMT in
(select [ANH_NORMTFrom] from tb where ANH_ID=1
union
select [ANH_NORMTTo] from tb where ANH_ID=1
)