In mysql, how to solve this sql?

DELETE FROM tusers WHERE (code,name) in(SELECT code,name FROM tusers GROUP BY code,name HAVING COUNT(*) > 1)

Why can"t I write like this? How do you write this?

Mar.18,2021

  • Why can't you write like this

     --
     
    Delete from [tusers] where id not in
    (
            SELECT MAX(id)        --max(id) :min(id)
    
            FROM [tusers]
    
            GROUP BY code,name    --group by
    )
MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1be8648-31901.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1be8648-31901.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?