Re: SQL query
Posted in 1998
Hello,
I think you should try
select accnum
from nlmst
group by 1
having count(*) > 1
Which will give you the rows that are duplicated.
The select you are using only shows diffrent values of accnum that you
have in the table.
Hope that helps
Serafim Fonseca
>
> 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."
>
==========================================================================
Serafim Fonseca e-mail: sf@growela.pt
Growela Portuguesa Calcado, Lda. phone : +351 2 9866300
S. Pedro Avioso, Castelo fax : +351 2 9812212
4470 Maia - PORTUGAL