Hi,

I want to list any duplicate records in my table. How can I do it with
a SQL SELECT DISTINCT command?

Thanks

Derek

Re: SQL SELECT DISTINCT by Eric

Eric
Tue Feb 15 03:51:02 CST 2005

If you use DISTINCT, you won't see the duplicates. Here's a sample:
<vfp_code>
CREATE CURSOR test (fld C(1))
INSERT INTO test VALUES ("A")
INSERT INTO test VALUES ("A")
INSERT INTO test VALUES ("b")
INSERT INTO test VALUES ("B")
INSERT INTO test VALUES ("B")
INSERT INTO test VALUES ("C")
INSERT INTO test VALUES ("C")
INSERT INTO test VALUES ("D")
INSERT INTO test VALUES ("d")
SELECT fld, count(*) as ncnt ;
FROM test ;
GROUP BY fld ;
HAVING ncnt > 1
</vfp_code>
--
Eric den Doop
www.foxite.com - The Home Of The Visual FoxPro Experts - Powered By VFP8

"julyderek@hotmail.com" <burzinb@gmail.com> wrote in message
news:1108459803.166872.23390@l41g2000cwc.googlegroups.com...
> Hi,
>
> I want to list any duplicate records in my table. How can I do it with
> a SQL SELECT DISTINCT command?
>
> Thanks
>
> Derek
>