大神们过来看下这条sql语句该如何优化、如何创建索引

浏览:480 发布日期:2014/12/15 分类:求助交流
$list = $Appointment->query('select * from ytghsys_'.Session::get('choosehospital').'appointment where (patient,telephone,hospital_id) in (select patient,telephone,hospital_id from ytghsys_'.Session::get('choosehospital').'appointment group by patient,telephone,hospital_id having count(*) > 1) and addtime >= '.strtotime("-2 month").' order by patient limit 2');

附件 L)0}WS%(HL6[6UB5IZI_WVP.jpg ( 215.34 KB 下载:4 次 )

最佳答案
评论( 相关
后面还有条评论,点击查看>>