SQL新手求教这段有无优化空间?SQL codecreate temporary table tbd(id int) select id from d where para
SQL新手求教这段有无优化空间?
SQL code
create temporary table tbd(id int) select id from d where para <> 1234;delete from t1 where id in (select id from tbd);delete from t2 where id in (select id from tbd);delete from t3 where id in (select id from tbd);delete from t4 where id in (select id from tbd);drop table tbd;
新手求教,有无改进空间?怎么改进?
[解决办法] delete t1 from t1,d where t1.id=d.id; delete t1 from t2,d where t2.id=d.id; delete t1 from t3,d where t3.id=d.id; delete t1 from t4,d where t4.id=d.id; [解决办法] explain ...不就知道了吗 [解决办法]