Re: SQL query
Posted in 1998
ccremid — — source: Informix-list mailing list archive (1991-1998)
Ian Clark wrote:
> 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?
Try:SELECT accnum, count(*) FROM nlmst
GROUP BY accnum
HAVING count(*) > 1
>
>
> Cheers, Ian.
> Tedious 'office speak' part 3: "Let's go scuba in the think tank."
Hope This helps
Tino