select uid from log where ip in(select ip from log group by uid having count(uid)>1) group by uid having count(ip)>=3;