Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Re: query taking too much time to execute

Re: query taking too much time to execute

From: gazzag <gareth_at_jamms.org>
Date: 26 Apr 2006 08:29:10 -0700
Message-ID: <1146065350.738969.301760@y43g2000cwc.googlegroups.com>


Kuldeep wrote:
> delete from ASSORTMENT
> where ASSORTM not in ( select min(ASSORTM)
> from ASSORTMENT
> group by ASSORTM2 )
>
> This query is teking too musc time to execute
>
> In ASSORTMENT there are 1,50,000 records
>
> somebdy has solution over it?

Ed's quite right about knowing one's data. However, if I were to hazard a guess, why not the following?

delete from ASSORTMENT
  where ASSORTM != ( select min(ASSORTM)

                                         from ASSORTMENT
                                         );

MIN() will only return the one value... Received on Wed Apr 26 2006 - 10:29:10 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US