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
mysql 链接 查询 速度超级慢
- 写回答
- 好问题 0 提建议
- 关注问题
- 邀请回答
-