這個(gè)是有什么使用場(chǎng)景限制嗎
是因?yàn)榘姹静粚?duì)嗎,怎么實(shí)際查出來(lái)不是這個(gè)效果
1.select? ?* from eb_user a left join eb_user_behaviour b on a.uid=b.uid? where b.active_time=(select MAX(c.active_time)? from eb_user_behaviour c where c.uid=a.uid)? 用時(shí)0.4s不到
2.select? ?a.*,b.active_time from eb_user a left join eb_user_behaviour b on a.uid=b.uid? left join eb_user_behaviour c on c.uid=b.uid? group by a.uid,b.date,b.active_time having b.active_time=MAX(c.active_time);? 用時(shí)接近10s
2021-01-16
把2里的a.*,b.active_time換成?a.uid,b.date,b.active_time呢?