日期:2014-05-18  浏览次数:20953 次

我想用“select distinct * from 表1”删除重复记录,但提示“不能以 DISTINCT 方式选择 text、ntext 或 image 数据
我想用“select distinct * from 表1”删除重复记录,但提示“不能以 DISTINCT 方式选择 text、ntext 或 image 数据类型”  
而我的表1的各个字段都是text、ntext 数据类型的,怎么办

------解决方案--------------------
delete from 表1 where rowid not in (
select max(t1.rowid) from 表1 t1 group by t1.rowid)


------解决方案--------------------
数据量不大的话,可以先select * from 表1到DataTable dt里,然后用

dt = dt.DefaultView.ToTable(true);

会自动去除重复值。