delete from porn where Id not in (select minid from (select min(id) as minid from porn group by viewkey) b);