题解 | #在last_update后面新增加一列名字为create_date#

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

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

delete from titles_test where not id in(select id from titles_test group by emp_no order by id asc)
不知道为什么这样就通过了,先以emp_no 分组,按id升序排序,然后删除掉其中id不等于这些最小值的记录

全部评论

相关推荐

评论
点赞
收藏
分享

创作者周榜

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