美文网首页
mysql 优化

mysql 优化

作者: 智勇双全的小六 | 来源:发表于2018-04-18 16:35 被阅读0次
    1. 用 join 代替子查询
      子查询
     select distinct(value) from tableName where name='minor_version' 
    and custins_id in (select id from tableName2 where parent_id=%s); 
    

    join

    select distinct(value) from tableName as t1
    join tableName2 as t2 on t1.custins_id = t2.id
    where t1.name='minor_version' and t2.parent_id=%s
    

    相关文章

      网友评论

          本文标题:mysql 优化

          本文链接:https://www.haomeiwen.com/subject/zqxbkftx.html