Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.server -> Re: SPOOKY SQL
Arlette BROSSARD escribió:
> =
> Be careful with ROWNUM when you use an ORDER BY clause. It doesn't work=
> every times.
> =
> I had some problems with it, so I read in Oracle 7 RDBMS :
> =
> Oracle7 assigns a ROWNUM value to each row as it is retrieved, before
> rows are sorted for an ORDER BY clause, so an ORDER BY clause
> normally does not affect the ROWNUM of each row. However, if an
> ORDER BY clause causes Oracle7 to use an index to access the data,
> Oracle7 may retrieve the rows in a different order than without the
> index, so the ROWNUMs may differ than without the ORDER BY
> clause.
I'm not sure but think it would be corrected by selecting the rule
optimizer:
alter session set optimizer_goal=rule;
Regards.
-- =
Julio Negueruela
DBA Servicio Informático
Universidad de La Rioja - Spain Telf: 941-299179 Fax: 941- 299180
![]() |
![]() |