mysql - find duplicate sets of data grouped by foreign key
In a subquery, fetch all the attributes (I cringe at EAV, too).
GROUP_CONCAT(... ORDER BY ...) as foo to combine them into a single string.
In the outer query, SELECT GROUP_CONCAT(ky) ... GROUP BY foo HAVING COUNT(*) &gt; 1 to get the duplicate kys.  (Please don't use the keyword "KEY".)


Give that a try.  If you get in trouble, show us SHOW CREATE TABLE and your failed attempt.  (Or abandon EAV.)

Some code (not quite mimicking the above prose):

SELECT `key`, CONCAT(`name`, '=', `value`) AS kv FROM tbl


should give you

key kv
87  Color=Red
87  Size=Big
...


Then...

SELECT `key`,
       GROUP_CONCAT(kv SEPARATOR '|' ORDER BY kv) AS kvs
    FROM ( -- the above query -- ) AS t1


should give you

key kvs
87  Color=Red|Size=Big|...
85  ...


Now...

SELECT kvs,
       GROUP_CONCAT(`key`) AS keys
    FROM ( -- second select -- ) AS t2
    GROUP BY kvs
    HAVING COUNT(*) &gt; 1


should give you

kvs                           keys
Color=Red|Size=Big|Weight=6   87,85
...  (perhaps not including 96)


I suggest you debug my code the way I wrote it -- test the first query to see if it gives you the first set of output, then second, then third.