Home > Database > Mysql Tutorial > 删除重复记录 sql语句

删除重复记录 sql语句

WBOY
Release: 2016-06-07 17:47:36
Original
1287 people have browsed it

删除重复记录 sql语句本教程为你提供了二款关于删除重复记录的sql语句代码。一个利用where in查询重复记录再实现删除,一个是用inner join来实例删除重记录。

删除重复记录 sql语句
本教程为你提供了二款关于删除重复记录的sql语句代码。一个利用where in查询重复记录再实现删除,一个是用inner join来实例删除重记录。
*/
//方法一

delete from tablea where title in (select a.title from tablea a join tableb b on a.title = b.title)

//方法二

delete a.* from tablea a
inner join tableb b on a.title=b.title
where 1

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