Good mysql Union table multi-Table query. In previous queries, you can directly select * from tablea as a, tableb. as B where. cc = B. cc. today, I will share a novel way of writing, and the execution efficiency of hundreds of thousands of data is quite fast. Here are some statements for multi-table queries: www.2cto.com SQL code # Invite friends to delete QQ information from Tbl_User where FQQ IN (select FDesQQ from Tbl_InviteHistory where FSrcQQ IN (select DISTINCT (FSrcQQ) from Tbl_ScoreDetail where FScore> '20140901' and FStrategy = '4') # delete the QQ data of illegal points from Tbl_User where fqq in (select DISTINCT (FSrcQQ) from orders where FScore> '200' and FStrategy = '4') # delete the invitation record for deleting all illegal points IN Tbl_InviteHistory from Tbl_InviteHistory where FSrcQQ IN (select DISTINCT (FSrcQQ) from Tbl_ScoreDetail where FScore> '20140901' and FStrategy = '4') www.2cto.com # delete the total points of illegal points IN Tbl_Score from Tbl_Score where fqq in (select DISTINCT (FSrcQQ) from Tbl_ScoreDetail where FScore> '2013' and FStrategy = '4 ') # delete invalid credit details IN detail delete from Tbl_ScoreDetail where FScore> '123' and FStrategy = '4' www.2cto.com # delete a user without Tbl_User in the Tbl_Score table delete from Tbl_Score where FQQ not IN (select FQQ from Tbl_User) delete from Tbl_ScoreDetail where FSrcQQ not IN (select FQQ from Tbl_User) // select fqq, FCode, FApplyTime FROM Tbl_Code where FQQ in (SELECT. fqq from (select count (*) as num, fqq from 'tbl _ Code' group by fqq having num> 20) as a) and FStatus = '1'