0

i have this query and it works fine.

This show items with duplicate attribute, like Golden armor [ID: 1]

SELECT * , SUBSTRING( CONVERT( attributes
USING latin1 )
FROM 18 ) AS 'Golden armor [ID: 1]'
FROM player_items
WHERE SUBSTRING( CONVERT( attributes
USING latin1 )
FROM 18 )
IN (

SELECT SUBSTRING( CONVERT( attributes
USING latin1 )
FROM 18 )
FROM player_items
WHERE CONVERT( attributes
USING latin1 ) LIKE '%Golden armor [ID: 1]%'
GROUP BY SUBSTRING( CONVERT( attributes
USING latin1 )
FROM 18 )
HAVING COUNT( * ) >1
)

But i want edit this to delete items with duplicate id instead show the items with duplicate id

Thanks.

  • 2
    Don't insert duplicates. Probably not what you want to hear, but it's a better approach than creating a maintenance headache. – Bryan Mar 17 '14 at 05:01
  • Hi thanks for answer, but i dont do this.. this happen when the players clone items, so this is the only way to detect and delete. – user3427501 Mar 17 '14 at 05:10
  • make the 2 keys a unique key so players can not do this, http://stackoverflow.com/questions/3798555/use-multiple-columns-as-unique-identifier-for-mysql – Bryan Mar 17 '14 at 05:17

0 Answers0