SQL基础语句原创
金蝶云社区-高小新
高小新
9人赞赏了该文章 364次浏览 未经作者许可,禁止转载编辑于2024年06月06日 10:18:19

删除关联关系处理数据库

select *  from T_BF_INSTANCEENTRY where 1=1 and FSTABLENAME ='t_PUR_POOrderEntry'

and fttablename='CGDD002629'

and FSID  in (select fentryid from  T_PUR_POORDER a 

inner join T_PUR_POORDERENTRY b on b.fid = a.fid  where a.FBILLNO='CGDD002629')

--查询

select *  from T_BF_INSTANCEENTRY where 1=1 and FSTABLENAME ='t_PUR_POOrderEntry'and

 FTTABLENAME ='T_AP_PAYABLEENTRY'and FSID  in (select fentryid from  T_PUR_POORDER a 

 inner join T_PUR_POORDERENTRY b on b.fid = a.fid  where a.FBILLNO='cgdd002629')

--备份

select * into T_BF_INSTANCEENTRY_sqlbak_20230613 from T_BF_INSTANCEENTRY;

--更新

delete  T_BF_INSTANCEENTRY where 1=1 and FSTABLENAME ='t_PUR_POOrderEntry'and FTTABLENAME ='T_AP_PAYABLEENTRY'and 

FSID  in (select fentryid from  T_PUR_POORDER a inner join T_PUR_POORDERENTRY b on b.fid = a.fid  

where a.FBILLNO='cgdd002629')


图标赞 9
9人点赞
还没有人点赞,快来当第一个点赞的人吧!
图标打赏
0人打赏
还没有人打赏,快来当第一个打赏的人吧!