Re: SQL query
Posted in 1998
>Hi All,
>I am trying to determine what records are duplicated in a table.
>select count ( distinct accnum ) from nlmst>returns 1138 rows, however;
>select count (*) from nlmst>returns 1170 rows.
>How do I find the records that are duplicated?
>Cheers, Ian.
>Tedious 'office speak' part 3: "Let's go scuba in the think tank."
One way of doing this is
select distinctive column, count(*) from nlmst
group by distinctive column
order by 2
This will put all columns where the count is greater than 1
at the top of the list. You can then check the duplicated values
of the distinctive column. This is kind of tedious and I am sure there
are other ways, this is just off the top of my head.
Craig Lanford
Mailto:craig.lanford@alltel.com