小林需要一个需求,基本的思想是这样的
比如说:
字段 id title
1 张三
2 李四
3 张三
4 王五
5 李四
最终结果是
id title
1 张三
2 李四
4 王五
偶给他想出来的方案是
create table tmp as select min(id) as col1 from blur_article group by title;
delete from blur_article where id not in (select col1 from tmp);
drop table tmp;