早起鸟儿 2018-11-14 11:02 采纳率: 0%
浏览 742
已结题

mysql 链接 查询 速度超级慢

select q.*,q1.project_money,q2.project_money from (
select z.idcard,z.customer_name,z.manager_code,z.manager_name,z.dep_id,z.dep_name,z.dep_look from tb_crm_newmoney z
where z.project=1
and z.record_date='2018-11-05'
union
select z.idcard,z.customer_name,z.manager_code,z.manager_name,z.dep_id,z.dep_name,z.dep_look from tb_crm_newmoney z
where z.project=1
and z.record_date='2018-11-06'
)q ,( select * from tb_crm_newmoney qc
where qc .project=1
and qc .record_date='2018-11-05'
)q1,( select * from tb_crm_newmoney qc
where qc .project=1
and qc .record_date='2018-11-06'
)q2
where q.idcard=q1.idcard and q.idcard=q2.idcard

  • 写回答

5条回答 默认 最新

  • zqbnqsdsmd 2018-11-14 11:04
    关注
    评论

报告相同问题?