MapInfo Products KnowledgeBase

Product: MapInfo Professional
Version: 8.0
Platform: Citrix; Windows 2003 Server Enterprise; Windows 98 SE; Windows NT 4.0 SP6A; Windows XP Home; Windows XP Home SP1A; Windows XP Home SP2; Windows XP Professional; Windows XP Professional SP 1A; Windows XP Professional SP 2; Windows 2000 Professional SP4
Category: Tools

Summary:
New tool available to delete duplicate column values in a table (MapInfo Professional v8.0).

Question:
New tool available to delete duplicate column values in a table (MapInfo Professional v8.0).

Answer:

A new tool in MapInfo Professional v8.0 called Delete Duplicates allows deleting duplicate records from a table while retaining map objects. This tool does not change the original table in any way. Keep in mind that MapInfo Professional has a 255 byte/ 5-column limit for a Group By clause, so it may be necessary to change the size of the columns if they are unusually wide.

When referring to duplicate rows, this mean rows that have duplicate occurrences of the same column value for the column that was selected.

Removing duplicate records from a table

To remove duplicate records from a table and save the cleaned table to a new file:

1. Add the Delete Duplicates tool to the Tool Manager using the instructions in Adding a Tool to the Tool Manager in the Tools Menu.

2. Open the table or tables to delete duplicates from.

3. From the Tools menu, click Delete Duplicates>Delete Duplicates to display the Delete Duplicate Records dialog box.

Figure: Delete Duplicate Records



The list of tables on the left contains all of the currently open tables. Make sure the tables to work with are open before opening the Delete Duplicates tool.

4. Select the table to delete duplicates from in the first column. A list of the columns in that table displays on the right.

5. Select the column that contains information that should be unique to each row from the Select Columns list. It is possible to select multiple columns to group by, but keep in mind MapInfo has a 254-byte (or in this case character) limit on any group by statement. Delete Duplicates will display an alert if this limitation has been exceeded.

CAUTION: The Delete Duplicate tool does not modify the original table. However, to avoid deleting data incorrectly, give this step a lot of thought. For example, it is not recommended to select customer names or addresses for this step.

6. Select the Count checkbox to add a column to the new table that shows the number of instances of the column value found in the original table. This is an optional feature.

7. Click OK. The Please Choose a Path dialog box displays.

8. Select a path and a file name for the new table in this dialog box. Then, select save. The tool removes rows containing duplicate column values according to the column that was selected. A browser window displays with the results of the new table.

Figure: NewCustomers2 Browser



Note: The last column contains the count of instances of the row containing duplicate column values in the original table.

Last Modified:
Document URL: http://testdrive.mapinfo.com/techsupp/miprod.nsf/kbase_by_product/8AF266D4E12AFE988525702A007B8C97

New tool available to delete duplicate column values in a table (MapInfo Professional v8.0).^8AF266D4E12AFE988525702A007B8C97^Y