如何找出重复的记录

Gop*_*pal 3 sql sql-server

使用Sql Server 2000

我想找出表中的重复记录

表格1

ID  Transaction Value

001 020102      10
001 020103      20
001 020102      10 (Duplicate Records)
002 020102      10
002 020103      20
002 020102      10 (Duplicate Records)
...
...
Run Code Online (Sandbox Code Playgroud)

交易和价值可以重复不同的id,而不是相同的id ...

预期产出

重复记录是......

ID  Transaction Value  
001 020102      10 
002 020102      10 
...
...
Run Code Online (Sandbox Code Playgroud)

如何查询查看重复记录.

需要查询帮助

Gab*_*oli 5

您可以使用

SELECT 
  ID, Transaction, Value
FROM 
  Table1
GROUP BY 
  ID, Transaction, Value
HAVING count(ID) > 1
Run Code Online (Sandbox Code Playgroud)