I have a question. Is there more than one field which needs to be summed? You mentioned payments and also quantity. Do you need to sum them both? Are there others?
I need more information before making a suggestion. Bill Cook Kent WA USA ----- Original Message ----- From: "Albert Berry" <[EMAIL PROTECTED]> To: "RBASE-L Mailing List" <[EMAIL PROTECTED]> Sent: Thursday, February 13, 2003 12:40 PM Subject: [RBASE-L] - Re: Duplicate Rows I think DELETE DUPLICATES FROM tablename is what you need here. Without the USING parameter, it will delete only exact matches on each and every column in the table. William Stacy <[EMAIL PROTECTED]> wrote: >If I understand it correctly, you should only need to compare the rows with one >big if command that is applied to each remaining row, something like: > >Do a select into v1,v2...vn of all the columns of the row you encounter with >your cursor follow it with > set v i=rownum where col1=.v1 and col2=.v2,.... and coln=.vn and rownum ne (not >equal) cursor_row_num > if i is not null then > del row from tablename where col1=.v1 and col2=.v2 ... and coln=.vn and >rownum ne cursor_row_num. > endi >[goto next row (that has not been deleted) and loop back to above] >bill > > >Chuck Finley wrote: > >> 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. > > -- Albert Berry Full Time Consultant to PSD Solutions 350 West Hubbard, Suite 210 Chicago, IL 60610 312-828-9253 Ext. 32 __________________________________________________________________ The NEW Netscape 7.0 browser is now available. Upgrade now! http://channels.netscape.com/ns/browsers/download.jsp Get your own FREE, personal Netscape Mail account today at http://webmail.netscape.com/

