<http://schema.org/articleBody>
"In SQL, there is no way that I know of to delete and update in one statement. So here is one solution (I have not tried it), requiring two statements. NOTE the difference between the T1.RRNBR : RRN(PROBLEMTBL) comparisons in the UPDATE and the DELETE. This is key to your specs. WITH T1 AS (SELECT SHIPPER, CONSIGNEE, PO, WAVE, COUNT(*) as COUNTER , MIN(RRN(PROBLEMTBL)) as RRNBR FROM PROBLEMTBL GROUP BY SHIPPER, CONSIGNEE, PO, WAVE HAVING COUNT(*) &amp;gt; 1 ) UPDATE PROBLEMTBL PT SET WAVE = 'MULTI' WHERE EXISTS (SE..."^^<http://www.w3.org/2001/XMLSchema#string>
<http://archive.midrange.com/midrange-l/201210/msg00093.html>