| Oracle FAQ | Your Portal to the Oracle Knowledge Grid | |
Home -> Community -> Usenet -> c.d.o.server -> Re: Oracle Queries/Paging
will the next way suit you
(an example based on my data)
select rownum RN, id,code from komioil.prim3
where ID>123
group by rownum,id,code
having rownum >2 and rownum <5
order by 3 desc
Best regards
Igor
<mlecza_at_my-deja.com>
> Yes - this works Very Well - until I start complicating things with
> awhere clause that looks like this (using interMedia Text):
>
> WHERE contains(HEADING,'animal%',1) >0 or contains
> (DESCRIPTION,'animal%',2) >0
> "Dmitry E. Loginov" <lde_at_mpsb.moris.ru> wrote:
> > Sorry, i overtyped...
> > U need to use group by in place showed below:
> > > U can build index for columns that u wanna to sort. And use hints..
> > > Or use next nested select:
> > >
> > > For ex we need to sort by Col_1, Col_2
> > > build index:
> > > create index YOUR_INDEX on YOUR_TABLE (Col_1, Col_2)
> > >
> > > use in select group by clause that implicitly use YOUR_IDEX and
> > > sort data
> > >
> > > select rn, col_1, col_2, Col_3, Col_4
> > > (select rownum rn, col_1, col_2, min(Col_3), Min(Col4)
> > > from YOUR_TABLE
> > group by rownum, col_1, col_2)
> > > where rn between :START_ROW and :END_ROW
Received on Sat Oct 16 1999 - 04:49:45 CDT
![]() |
![]() |