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')
这个就是ANH_ID=1 的两列作为in值
分享到:
------解决方案--------------------
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 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]=你需要的值) ------解决方案-------------------- 你插入这列的时候写成
select ANH_ID from tb where ANH_NORMT in ('GX-15C/B3','GX-15C/B4') ------解决方案-------------------- delete from tb where ANH_NORMT in(select ANH_NORMTFrom from T_PO_AdjustmentNORMTHeader where id=1
union all
select ANH_NORMTTo from T_PO_AdjustmentNORMTHeader where id=1) ------解决方案-------------------- 还有其他问题吗? ------解决方案--------------------
还有其他问题吗?
有~~tb. [ANH_NORMTFrom]=a. [ANH_NORMTFrom] and tb.[ANH_NORMTTo]=a.[ANH_NORMTTo]这里貌似要用or哦~
还有老大有空帮我看看我那关于dormant的提问呗 ------解决方案--------------------
还有其他问题吗?
有~~tb. [ANH_NORMTFrom]=a. [ANH_NORMTFrom] and tb.[ANH_NORMTTo]=a.[ANH_NORMTTo]这里貌似要用or哦~