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: Problem with Order by of a date

Re: Problem with Order by of a date

From: Carlos <miotromailcarlos_at_netscape.net>
Date: 8 Nov 2005 12:11:11 -0800
Message-ID: <1131480671.001611.89900@f14g2000cwb.googlegroups.com>


ROWNUM is ALWAYS evaluated before ORDER BY.

One solution (not the best one, IMHO) is:

SELECT lista_campi_tpr,

             date_import
  FROM ( SELECT lista_campi_tpr,

                            date_import
                 FROM CELL_PR cp
              WHERE  cp.id_cella = 'PZ81U1'
          ORDER BY date_import DESC )

   WHERE ROWNUM < 2

Cheers.

Carlos. Received on Tue Nov 08 2005 - 14:11:11 CST

Original text of this message

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