题解 | #删除emp_no重复的记录,只保留最小的id对应的记录。#

删除emp_no重复的记录,只保留最小的id对应的记录。

http://www.nowcoder.com/practice/3d92551a6f6d4f1ebde272d20872cf05

delete from titles_test where id not in (select * from (select min(id) from titles_test group by emp_no) as a)

delete from titles_test where id not in

(select min(id) from (select id from

titles_test group by emp_no) as a)

delete from titles_test

where id not in(select *

from

(select min(id)from titles_test

group by emp_no)as a);

全部评论

相关推荐

09-30 15:27
已编辑
成都工业学院 企业文化
Morpheus_:候选人:还需要测验武力值?
投递腾讯等公司10个岗位
点赞 评论 收藏
分享
评论
点赞
收藏
分享

创作者周榜

更多
正在热议
更多
牛客网
牛客网在线编程
牛客网题解
牛客企业服务