gausie Posted July 9, 2007 Share Posted July 9, 2007 I need to select all rows in my table that are duplicates. But the classification of being duplicates are if they have any other rows with the same "user_id" and "item_id". Even if the other columns are different, it is still a duplicate if those two are the duplicated anywhere. Can someone help me with this query? gausie Link to comment https://forums.phpfreaks.com/topic/59106-specific-duplicate-finding/ Share on other sites More sharing options...
Wildbug Posted July 9, 2007 Share Posted July 9, 2007 SELECT CONCAT(user_id,' & ',item_id) AS useritem_id,COUNT(*) AS num FROM table GROUP BY useritem_id HAVING num > 1; Post table definition and an example case if you want more detail. Link to comment https://forums.phpfreaks.com/topic/59106-specific-duplicate-finding/#findComment-293545 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.