0

我有一张桌子

Id int
Post code int
Suburb varchar
State varchar

我需要能够找到组合的重复项(post code, suburb, state)

并将它们插入到记录错误数据的绝望表中

Eg
Id int
Post code int
Suburb varchar
State varchar
4

1 回答 1

2
INSERT INTO IncorrectResults (PostCode, Suburb, State)
SELECT PostCode, Suburb, State
FROM MyTable
GROUP BY PostCode, Suburb, State
HAVING COUNT(*) > 1
于 2013-04-13T12:31:03.143 回答