Re: SQL query
Posted in 1998
Ian Clark — — source: Informix-list mailing list archive (1991-1998)
On Tue, 03 Feb 1998 16:16:38 GMT, ian@tubeway-army.demon.co.uk (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?
>
Hi All,
To all those who responded to my question, both here and via Email, I
thank you :-)
Most favoured solution was:
select accnum, count(*) from nlmst
group by accnum
having count(*) > 1;
which did the job perfectly.
Cheers, Ian.
Tedious 'office speak' part 3: "Let's go scuba in the think tank."