34,874
社区成员
发帖
与我相关
我的任务
分享[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
[/quote]你那个我暂时没有太多知识储备,所以一直没回复
手机给偷了,纠结郁闷中,两个列匹配用and[/quote]
那是你看错了吧,lz要用ANH_NORMT这个列去匹配另两个列值啊~
好吧,咱俩一起节哀。。。
[/quote]你那个我暂时没有太多知识储备,所以一直没回复
手机给偷了,纠结郁闷中,两个列匹配用and
还有其他问题吗?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
)