Hi Travis,

I find I have to do this in three stages.  The following assumes you have a
table called mytable with a field called myfield in which you are looking
for duplicates.
It creates two temporary tables, mytablecount and mytabledups.  The final
table 'Duplicates' contains the records from the original table that have
duplicate values in the myfield field.

I also get an error message after the second select statement - which I
ignore (this is a bug that was to be fixed in 5.5 but I am still running
5.0)


        SELECT MyField,count(*) FROM MyTable group by myfield into
mytableCount
        SELECT MyField FROM MyTableCount where col2 > 1 into MytableDups
        SELECT  * FROM MyTable WHERE MyTable.MyField In (SELECT MyField FROM
MyTableDups) into Duplicates 


To find duplicate records in a table where the duplicate information may
spread over several columns you would need to either append these fields
together (and query that new field as above) or alter the SQL to handle the
multiple fields - I think this latter approach will cause problems with the
embedded select statement.

Hope this helps

Martin

==================================
Martin Roundill
GIS Manager
Waitakere City Council
Private Bag 93109
Henderson
Waitakere City
New Zealand

-----Original Message-----
From: Lathrop, Travis [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, 23 February 2000 06:45
To: [EMAIL PROTECTED]
Subject: MI Date: Tue, 22 Feb 2000 11:42:47 -0600


What SQL will select duplicate entries in the same table.

Travis Lathrop
Intercarrier Services
(816) 559-3014


----------------------------------------------------------------------
To unsubscribe from this list, send e-mail to [EMAIL PROTECTED] and put
"unsubscribe MAPINFO-L" in the message body, or contact [EMAIL PROTECTED]
----------------------------------------------------------------------
To unsubscribe from this list, send e-mail to [EMAIL PROTECTED] and put
"unsubscribe MAPINFO-L" in the message body, or contact [EMAIL PROTECTED]

Reply via email to