select log_mon,user_id,count(distinct log_date) as log_cnt from t_login group by user_id,log_mon having count(distinct log_date)>3 我记得好像是这样...