Re: Need to delete duplicate rows

From: Simon B <sbrunning_at_trisystems.co.uk>
Date: 2000/04/18
Message-ID: <38fc488c.0_at_nnrp1.news.uk.psi.net>#1/1


Karl Hewlett wrote in message
<8dgiks$jk2$1_at_scream.auckland.ac.nz>...
>Someone suggested select distinct into a temp table which will
 work, another
>solution would be:
>
>(Its been a while since I have had to do this so you may have to
 play with
>the syntax)
>
>delete from sales a
>where rowid = (select max(b.rowid)
> where a.item_code = b.item_code
> and <snip>
> );

IIRC, you are on an AS/400. On the '400, use

where rrn(a) = (select max(rrn(b))
etc.

--
Cheers,
Simon Brunning
TriSystems Ltd.
sbrunning_at_trisystems.co.uk
The opinions expressed are mine, and are not necessarily those of my
employer.
Received on Tue Apr 18 2000 - 00:00:00 CEST

Original text of this message