× 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.



Thanks Elvis and Charles,

Almost there!  When I run the statement:

WITH preserve AS                                                  
(SELECT SCACCODE,TRLRNUM,ASNNUM,ORDERTYP,ORDERNUM,MIN(KDLOTSTR) AS
KDLOTSTR FROM SSW85                                               
GROUP BY SCACCODE, TRLRNUM, ASNNUM, ORDERTYP, ORDERNUM)           
(DELETE FROM SSW85 A,preserve P WHERE A.SCACCODE = P.SCACCODE AND 
A.TRLRNUM  = P.TRLRNUM  AND                                       
A.ASNNUM   = P.ASNNUM   AND                                       
A.ORDERTYP = P.ORDERTYP AND                                       
A.ORDERNUM = P.ORDERNUM AND                                       
A.KDLOTSTR   <> P.KDLOTSTR)                                       

The system balks at the (DELETE FROM SSW85...) statement with the error
"Keyword DELETE not expected. Valid tokens: ( SELECT."

However, when I change it to:

WITH preserve AS                                                   
(SELECT SCACCODE,TRLRNUM,ASNNUM,ORDERTYP,ORDERNUM,MIN(KDLOTSTR) AS
KDLOTSTR FROM SSW85 
GROUP BY SCACCODE, TRLRNUM, ASNNUM, ORDERTYP, ORDERNUM) 
(SELECT * FROM SSW85 A,preserve P WHERE A.SCACCODE = P.SCACCODE AND
A.TRLRNUM  = P.TRLRNUM  AND 
A.ASNNUM   = P.ASNNUM   AND 
A.ORDERTYP = P.ORDERTYP AND
A.ORDERNUM = P.ORDERNUM AND 
A.KDLOTSTR   <> P.KDLOTSTR)

I get back all the data I need to complete this query.

I'll keep playing with it to see if I can get it to either delete the
rows in question or dump the results into another table.  However, any
other ideas would be most appreciated.

Thanks all!

Brian.





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.