Re: SQL query
Posted in 1998
Ian,
Try:
select accnum, count(*) from nlmst
group by accnum
having count(*) > 1;
Hope this helps!
Alicia Ray
On Feb 3, 4:16pm, Ian Clark wrote:
> Subject: SQL query
> 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."
>-- End of excerpt from Ian Clark
--
**********************************************************************
Alicia Ray Internet : Alicia.Ray@med.osd.mil
EDS-D/SIDDOMS Phone : 703-845-3807
5113 Leesburg Pike
Skyline 4 Suite 800
Falls Church, VA 22041-3201
**********************************************************************