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

Home -> Community -> Usenet -> c.d.o.server -> Re: invalid rowid when pl/sql cursor has subquery with group function

Re: invalid rowid when pl/sql cursor has subquery with group function

From: <ssharma_at_clearnet.com>
Date: 1998/04/01
Message-ID: <6fv2e7$b1c$1@nnrp1.dejanews.com>#1/1

Thanks for taking the time to reply.

I ended up doing this:
select hell, hell_sequence from hell_below minus

   select hell, min(hell_sequence) from hell_below group by hell;

This solution is data - specific, and yours is very general. I'll benchmark and choose.

Thanks again

From: tkyte
Subject: Re: invalid rowid when pl/sql cursor ha Date: Wednesday, April 01, 1998 10:05PM

>Hello.
>Here's the simplest query to duplicate my problem
>
>declare
>cursor a is select hell from
> (select hell, count(*) cnt from hell_below group by hell)
> where cnt > 1;
>hell_rec number;
>begin
>open a;
>fetch a into hell_rec;
>end;
>

 [snip]
>
>
>Any way around this? any easier way to find duplicates

simplest workaround:

select hell
  from hell_below
 group by hell
having count(*) > 1;

having is like WHERE but it allows access to aggregates after they have been computed.

-----== Posted via Deja News, The Leader in Internet Discussion ==----- http://www.dejanews.com/ Now offering spam-free web-based newsreading Received on Wed Apr 01 1998 - 00:00:00 CST

Original text of this message

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