请求一条sql语句 delete from t where id not in (select max(id) from t group by name) 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 delete from t where id not in (select min(id) from t group by name) --保留id最小记录delete from t tbwhere exists(select 1 from t where name=tb.name and id<tb.id)--保留id最大记录delete from t tbwhere exists(select 1 from t where name=tb.name and id>tb.id) 当GROUP BY 与ORDER BY 一起使用时 一个查询,3Q 求SQL:入库时存在更新库存数,不存在插入记录 请教一个Insert语句的问题 关于SQL2000所有者的一个问题 sql语句 sql server 7.0 升级 2000 出现的问题 急求SQL大神,大牛,大拿显灵,SQL语句问题!!!!!! 紧急求助(这样的触发器怎么写) 数据显示的时候怎么加星号? 求助!!!!SQL SERVER 2000安装程序配置服务器失败 如何在 sql 2000 中 设置 这样的一个用户 ??????
delete from t tb
where exists(select 1 from t where name=tb.name and id<tb.id)--保留id最大记录
delete from t tb
where exists(select 1 from t where name=tb.name and id>tb.id)