× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



Michael, you can do this neatly with a QMQRY, if you are talking about the 
entire row being duplicated. Go to STRQM, then option 1 for QMQRY. Create a new 
one called CUTDUPES, say, and put

SELECT DISTINCT * FROM YOURLIB/YOURFILE

as the statement. This eliminates the duplicates.

Now at a command line use

STRQMQRY CUTDUPES OUTPUT(*OUTFILE)
OUTFILE(YOURLIB/YOURFILE)
OUTMBR(*FIRST *REPLACE)

You are telling it to create a record set that consists only of the distinct 
records, then take that record set and save it back to the same place it came 
from. It will replace the contents of the file with the output of the SELECT 
statement. STRSQL will not allow this - it blocks using the same file for 
output as the one named in the SELECT (F13 is where I tried to set this up).

The STRQMQRY technique is definitely dangerous and not for the faint of heart - 
but very handy when needed.

HTH
Vern

-------------- Original message -------------- 

> How can I delete duplicate rows in Interactive SQL? I know how to find 
> them...I don't know how to delete all the dups and just leave one row 
> in a group. 
> 
> TIA... 
> 
> -- 
> This is the Midrange Systems Technical Discussion (MIDRANGE-L) mailing list 
> To post a message email: MIDRANGE-L@xxxxxxxxxxxx 
> To subscribe, unsubscribe, or change list options, 
> visit: http://lists.midrange.com/mailman/listinfo/midrange-l 
> or email: MIDRANGE-L-request@xxxxxxxxxxxx 
> Before posting, please take a moment to review the archives 
> at http://archive.midrange.com/midrange-l. 
> 

As an Amazon Associate we earn from qualifying purchases.

This thread ...


Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.