因為有遇到這個問題
所以特別寫出來備忘
SELECT *
FROM bb_downloads a
WHERE
(SELECT count( * )
FROM bb_downloads b
WHERE b.post_id = a.post_id
AND b.url = a.url
) >1
ORDER BY `post_id`,`download_times` DESC
UPDATE: 2007/10/14
找出不相同的資料
非常的easy
select r.user_id from rtable r WHERE r.user_id not in (select a.user_id from atable a)
刪除不相同的資料
delete from rtable WHERE user_id not in (select a.user_id from atable a)