Home  >  Article  >  Database  >  处理表重复记录(查询和删除)

处理表重复记录(查询和删除)

WBOY
WBOYOriginal
2016-06-07 17:39:331199browse

处理表重复记录(查询和删除) 查询 1、Name相同的重复值记录,没有大小关系只保留一条 2、Name相同,ID有大小关系时,保留大或小其中一个记录 一、用于查询重复处理记录(如果列没有大小关系时SQL2000用生成自增列和临时表处理,SQL2005用row_number函数处理) 生成

处理表重复记录(查询和删除)

查询
1、Name相同的重复值记录,没有大小关系只保留一条
2、Name相同,ID有大小关系时,保留大或小其中一个记录
 
一、用于查询重复处理记录(如果列没有大小关系时SQL2000用生成自增列和临时表处理,SQL2005用row_number函数处理)
 
生成测试数据

() #T #T 5 ( , (1) , (2) 9 ) 10 INSERT #T , N, N, N, N, N, N, N, N, N, N ,香港空间,香港虚拟主机,香港空间

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn