Home > Database > Mysql Tutorial > body text

删除user表(含字段id和字段name)中重复的name字段,保留唯一的

WBOY
Release: 2016-06-07 14:57:09
Original
1496 people have browsed it

这个是我在一次面试中碰到的Oracle笔试题,但当时没做出来,回来后就过研究做出来了。把代码贴出来,分享给大家,希望对跟我一样在求职中的有用。 无 delete from user where id not in(select min(id) from user group by name);

这个是我在一次面试中碰到的Oracle笔试题,但当时没做出来,回来后就过研究做出来了。把代码贴出来,分享给大家,希望对跟我一样在求职中的有用。
delete from user where id not in(select min(id) from user group by name);
Copy after login
Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template