SELECT DISTINCT t1.DownloadID FROM `yourtable` as t1, `yourtable` as t2 WHERE t1.CategoryID != t2.CategoryID and t1.DownloadID = t2.DownloadID;