需要删除数据的表A,需删除大概200W条数据,其中where条件涉及到其他表,我的语句如下
delete from A where A.id in (select id from B where 条件1 and 条件2 and 条件3)
这样很慢,因为A表中有300W条记录 过滤条件中有200W条记录。求教有没有其他方式,我想用表连接 但是delete语句中好像没法实现。
delete from A where A.id in (select id from B where 条件1 and 条件2 and 条件3)
这样很慢,因为A表中有300W条记录 过滤条件中有200W条记录。求教有没有其他方式,我想用表连接 但是delete语句中好像没法实现。
delete a from A
inner join
(select id from B where 条件1 and 条件2 and 条件3) c
on A.id=c.id
inner join
(select mbr_cid from smg_t ) c
on a.mt=c.mbr_cid
这是我的语句
inner join
(select mbr_cid from smg_t ) c
on a.mt=c.mbr_cid
这是我的语句
delete a from smg_logl a
inner join
(select mbr_cid from smg_t ) c
on a.mt=c.mbr_cid
where A.id=B.id and B.条件1 and B.条件2 and B.条件3