Re: SQL info

From: Someone <azmoodeh_at_netcom.com>
Date: 1995/09/14
Message-ID: <azmoodehDEwnH1.6Ez_at_netcom.com>#1/1


: hum... I don't really know if it's possible, but
: check the following statements :
 

: select * from (select * from table order by colum_a)
: where rownum < 5;

The idea is right, but your SQL is wrong.

Try this:

	select * from table
	where exists
		(select * from table
		order by column_a)

	where rownum < 5;

Hope this helps.
Mickey.

: You can also (if you've an index on column_a) specify a "hint" to the parser
: so as to make him scan the scan in the order you want. In that case also, I
: don't know if the pseudo rownum column will be computed before or after the
: order clause, it depends on the way the parser would analyse it (explain
: plan). Check your 'Application Developper's Guide' - Chapter 5 for more info
: about hints.
 

: Bye.
 

: -------------------------------------------------------------
: ('< Gilles BRUNO. Universite Joseph Fourier.
: ,',) Tel: +33 76 63 56 68 Fax: +33 76 51 42 74
: ''<< E-mail: Gilles.Bruno_at_ujf-grenoble.fr
: ----""-------------------------------------------------------
  Received on Thu Sep 14 1995 - 00:00:00 CEST

Original text of this message