Chuck:

Here are some suggestions you could try:

1:  DELETE DUPLICATES FROM <tablename> will delete any rows that have
exactly the same data in more than one row.

2:  Create a new table with the same exact structure as your source and then
populate the new table with a command such as the following:  INSERT INTO
<newtable> <column list> SELECT col1,col2,col3,col4,. . . FROM <sourcetable>
GROUP BY col1,col2,col3,col4,. . .

3:  Create a new table with the same exact structure as your source and then
populate the new table with a command such as the following:  INSERT INTO
<newtable> <column list> SELECT DISTINCT col1,col2,col3,col4,. . . FROM
<sourcetable>

If you want to verify the data you could do something like this:

SELECT col1,col2,col3,col4,COUNT(*) FROM <sourcetable> GROUP BY
col1,col2,col3,col4 HAVING COUNT(*) > 1
will show you exactly what rows are duplicated.

Check out the syntax for some of these suggestions so that you understand
them better.  They are very powerful.

Hope this helps.

Mike Ramsour


-----Original Message-----
From: Chuck Finley [mailto:[EMAIL PROTECTED]]
Sent: Thursday, February 13, 2003 2:51 PM
To: [EMAIL PROTECTED]
Subject: [RBASE-L] - Duplicate Rows






Hopefully one of you very smart people can help me out. I imported data into
a table that contains customer payment information. Multiple months of
payments are included in this data. Often all rows are duplicates including
a the quantity column. Is there an easy way to compare rows and when all
columns are the same to tally the quantity and delete all rows except one
and then update the quantity to the correct number. I have written a cmd
file that accomplishes this by stepping through  the table with a cursor and
uses a boatload of nested if / then statements to check is all the rows are
exactly the same,  but this just seems real inefficient to me. I hope I am
missing a way to compare two entire rows. Any ideas would be much
appreciated.

Reply via email to