首页 > 代码库 > mysql 优化语句
mysql 优化语句
优化前:
select b.type, ifnull(count(0),0) as qty from b_sell_quotationd a,b_sell_quotation b where b.quotationNo=a.quotationNo and a.status=‘N‘ and b.companycode=‘XXXXX‘ AND b.type=‘general‘;
优化后:
select COUNT(0) from b_sell_quotationd a LEFT JOIN (SELECT * FROM b_sell_quotation WHERE type=‘general‘) b ON b.quotationNo=a.quotationNo WHERE b.companycode=‘XXXXXX‘ and a.status=‘N‘
mysql 优化语句
声明:以上内容来自用户投稿及互联网公开渠道收集整理发布,本网站不拥有所有权,未作人工编辑处理,也不承担相关法律责任,若内容有误或涉及侵权可进行投诉: 投诉/举报 工作人员会在5个工作日内联系你,一经查实,本站将立刻删除涉嫌侵权内容。