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 -> "limit 10" vs "rownum <=10"

"limit 10" vs "rownum <=10"

From: Mark Harrison <mh_at_pixar.com>
Date: Tue, 01 Aug 2006 19:09:46 GMT
Message-ID: <_FNzg.3450$uo6.3373@newssvr13.news.prodigy.com>


So, we've got some inter-database portability issues we're trying to address.

sqlite uses: select * from foo limit 1;
oracle uses: select * from foo where rownum <= 1;

What's the conventional wisdom on how to handle this? Is there something in oracle we can turn on to help?

Right now we're thinking of some logic like:

    if oracle, string substitute "limit x" with "where rownum <= x" and try to handle the cases when there is already a where clause, etc.

Many TIA,
Mark

-- 
Mark Harrison
Pixar Animation Studios
Received on Tue Aug 01 2006 - 14:09:46 CDT

Original text of this message

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