如何消重复的数据

areasd 2003-06-26 04:55:55
在程序中,如何使重复的数据项删除剩一项,数据库为SQL SERVER7
...全文
23 4 打赏 收藏 转发到动态 举报
写回复
用AI写文章
4 条回复
切换为时间正序
请发表友善的回复…
发表回复
zhpsam109 2003-06-27
  • 打赏
  • 举报
回复
用distinct关键字!

例如:查看产品共有多少种类(不能重复)

select distinct 种类 from 产品表
痞子酷 2003-06-26
  • 打赏
  • 举报
回复
oralce:
delete from table
where rowid not in (select id,max(rowid) from table group by id)
叶子哟 2003-06-26
  • 打赏
  • 举报
回复
这个得具体情况具体分析
select * into temp form table1 group by id(你的关键字或是自增量)//或是用临时表
delete from table1
insert into table1 select * from temp




hzhxxx 2003-06-26
  • 打赏
  • 举报
回复
select distinct from tablename

1,178

社区成员

发帖
与我相关
我的任务
社区描述
C++ Builder 数据库及相关技术
社区管理员
  • 数据库及相关技术社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧