SQL 删除如何使用。。。。。 delete from tablename where fieldname=要删除的; 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 一般的办法使用游标删除,在sql中当不包括text,image时可以通过临时表来做. 如果纪录不全相同可用自连接或group by...having操作,若完全相同,只有写程序或过程了 给你一个方法delete tablename from tablename,(select 重复字段 as iiid max(primary key) as iid tablename group by 重复字段 having count(*)>1) as k where tablename.primary key<k.iid and tablename.重复字段 =k.iiid 如果是oracle/informix可用rowid或rownumber来区别,因为在一张表中rowid,rownumber不会有重复。 towwl007(疑难杂症):看不明白?请指教! 你有主键字段吗?如果有,试试下面的语句delete from 表名 where 主键字段 not in(select min(主键字段) from 表名 group by 重复的字段名 having count(重复的字段名)>1) 什么数据库?如果是oracle就简单多了delete from table1 a where rowid <(select max(rowid) from table1 b Where 重复字段名 = a.重复字段名) 数据库中遇到0要赋成1在线等 分几步我也可以解决,可是能不能用一句解决呢? 把一张表分成多张格,这样可取吗? 求sql command-每item 最top 1之資料 急sql 2000问题 数据库备份和恢复的系统存储过程是什么? 文本文件导入的问题 小康问题:Access数据库与MS SQL数据库之间数据同步问题,请大虾不吝赐教!~ SqlServer大量读取数据 update with(rowlock)不能用 如何将某字段的值转化为大写? 这样的系统应该用什么样的数据库结构好?请指点,谢谢!
delete tablename from tablename,(select 重复字段 as iiid max(primary key) as iid tablename group by 重复字段 having count(*)>1) as k where tablename.primary key<k.iid and tablename.重复字段 =k.iiid
delete from 表名 where 主键字段 not in(select min(主键字段) from 表名 group by 重复的字段名 having count(重复的字段名)>1)
delete from table1 a
where rowid <(select max(rowid)
from table1 b
Where 重复字段名 = a.重复字段名)