SQL Server DB에서 중복을 찾으려면 아래 스크립트를 참조하십시오. 더 깨끗한 방법이 있습니까?Uisng이 sql에 중복 된 것을 찾으려면 더 깨끗한 방법이 있습니까?
select itemnum
from matusetrans a
where exists (select null
from matusetrans b
where a.itemnum = b.itemnum
and a.actualdate = b.actualdate
and a.matusetransid != b.matusetransid
and (a.rotassetnum = b.rotassetnum
or (a.rotassetnum is null and b.rotassetnum is null))
and a.quantity = b.quantity)
group by itemnum
명확하게 "중복"를 정의하십시오 수 있습니다. 행의 모든 열이 일치하는 두 개의 레코드를 말하는 것입니까? – Mfusiki
안녕 Mfusiki, 예 코드 내에서 기준이 일치하는 곳에서 중복됩니다. –
이 스레드를 참조하십시오 : http://stackoverflow.com/questions/2594829/finding-duplicate-values-in-a-sql 표 – Mfusiki