如果存在不重复的字段ColAdelete a from news a where exists(select 1 from news where title=a.title and ColA<a.ColA)
select a.* from news a where exists(select 1 from news where title=a.title and ColA!=a.ColA)
记录行是完全相同怎么办?? ---- select col1,col2...... from table group by col1,col2.... having count (1) > 0不是完全相同又怎么办??? --- 比如colN不同 select * from table a where not exists(select 1 from table where col = b.col and col1= b.col1 and colN > a.colN)
select * from news where title in (select title from (select title,count(title) as CountTitle from test Group by title) Temptbl where CountTitle>1) 可以查处Title重复的所有记录。
delete * from news where title in(select title form news a group by title having count(title)>1)
----
select col1,col2......
from table
group by col1,col2....
having count (1) > 0不是完全相同又怎么办???
---
比如colN不同
select *
from table a
where not exists(select 1 from table where col = b.col and col1= b.col1 and colN > a.colN)
(select title from
(select title,count(title) as CountTitle from test Group by title) Temptbl
where CountTitle>1)
可以查处Title重复的所有记录。