Re: Who supports the LIMIT clause in a SELECT statement
Posted in 1999
Topics: SQL Development & Query Writing
> Actually rownum will only be usable to get the first # of rows, not for, say,
> the 15th to the 30th as requested in the original question....
>
> you could use
> select * from table where rownum < 45> minus
> select * from table where rownum < 30>
> and it will return rows 31 - 45 (won't it return 31 to 44?)
>
I don't use Oracle, but my company is considering it...
Why couldn't you do this:
select * from table where rownum between 31 and 44
or
select * from table where rownum >= 31 and rownum <= 44
--
CB
-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
cbusch@my-dejanews.com wrote:
>
>
>> Actually rownum will only be usable to get the first # of rows, not for, say,
>> the 15th to the 30th as requested in the original question....
>>
>> you could use
>> select * from table where rownum < 45>> minus
>> select * from table where rownum < 30>>
>> and it will return rows 31 - 45 (won't it return 31 to 44?)
>>
>
>I don't use Oracle, but my company is considering it...
>
>Why couldn't you do this:
> select * from table where rownum between 31 and 44
>or
> select * from table where rownum >= 31 and rownum <= 44>
>
>--
>CB
>
>-----------== Posted via Deja News, The Discussion Network ==----------
>http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
Because, in Oracle, the Rownum is used only as a incrementing counter ( so it
'forgets' each number as it is changed when a new row is returned ) ...it can
only be used with operators that 'look at' the current value of the number and
check for = or < to the test value.....
Hope it clarifies....
To reply please remove the 'nospam' part of the address