April 7th, 2008

ecms 后台查询重复标题有几千个,怎样一次性删除

Category: Default, Author: humker, Popularity: 1%

在phpmyadmin中输入如下语句
DROP  TABLE  IF  EXISTS  newstemp1;
CREATE  TEMPORARY  TABLE  
newstemp1(id  VARCHAR(10),title  VARCHAR(250))  TYPE=HEAP;
insert  into  newstemp1(id,title)  select  max(b.id),b.title  from  phome_ecms_news  a  ,  phome_ecms_news  b  where  a.title=b.title  and  a.id!=b.id  group  by  b.title;
delete  phome_ecms_news  a  from  phome_ecms_news  a,newstemp1  b  where  a.title=b.title  and  a.id!=b.id;

随机文章


评论数量(0) | Add Comments
本文网址:http://www.humker.com/2008/04/07/ecms-delete-same-title/

There are No comments.

» You can leave a response or Trackback .

leave a reply