🔥码云GVP开源项目 12k star Uniapp+ElementUI 功能强大 支持多语言、二开方便! 广告
## 删除重复中最小(大) ``` DELETE FROM student INNER JOIN ( SELECT min(table_id) AS minId, age FROM student GROUP BY name HAVING count(*) > 1 ) t2 ON t2.age = student.age WHERE student.table_id > t2.minId; ``` ## 表锁死后的操作 ``` mysql -uroot -pMySQL123 -e "show processlist;" | grep -i 'delete' | awk '{printf "mysql -uroot -e \"kill %d;\"",$1}' | sh ```