1. one table join itself
select file.id from history t1, history t2, file where file.id=t1.file_id and t1.id<>t2.id and t1.updated_at=t2.updated_at and t1.ip=t2.ip and t1.file_id<>114 and t2.file_id=114 group by t1.file_id order by count(t1.file_id) desc;
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment