search

Home  >  Q&A  >  body text

mysql 比较两个表数据优化问题

PHP中文网PHP中文网2783 days ago781

reply all(2)I'll reply

  • PHP中文网

    PHP中文网2017-04-17 16:44:31

    // acc_id 加索引
    SELECT accinfo_id FROM acc_accinfo acc
    
    WHERE acc.`is_delete` = 1 AND  acc_id NOT in (
        SELECT  acc_id FROM acc_circulate_setting where area_id = 1  AND is_delete = 1 
        );
        
     // 或者分2步查   

    reply
    0
  • 阿神

    阿神2017-04-17 16:44:31

    Is the accinfo_id of acc_accinfo not indexed

    reply
    0
  • Cancelreply