Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Re: returning certain rows from a SELECT

Re: returning certain rows from a SELECT

From: nooruddin <nooruddin76_at_telebot.net>
Date: Mon, 12 Jul 1999 15:45:35 +0530
Message-ID: <7mdjnt$5gl$1@news.vsnl.net.in>


Hi neil I'm nooruddin.

I think I got your problem.

I dont know much about perl but i could help u retrieve selected no of rows from a table lets say from row number 5 to 10

here's the select query for that:

select max(anyrowname),max(anyrowname) from tablename group by rowid having max(rownum) between 5 and 10;

in the above example replace anyrowname with actual rowname of the table you are querying, but donot change anyother thing like

max(rownum) ---type exactly as it is.
That'll solve the problem.

If u have problems with that let me know.

Bye....

Neil Kandalgaonkar wrote in message <7m38lt$ans$1_at_newsflash.concordia.ca>...
>Hello, I'm new to Oracle, maybe my approach here is completely wrong,
>but here's my problem:
>
>I am using Oracle8 through Perl's DBI. I would like to obtain specific
>row-ranges from my SELECT statements, i.e., give me rows 26-50 of 'SELECT
>* FROM foo'.
>
>I can get this to work nicely in SQLPLUS using a cursor, loop, and
>%ROWCOUNT, but these results are all printed to the screen, inserted into
>a temporary table, or something similar.
>
>How can I make a function (?) or something similar (?) that will return
>rows that DBI will understand?
>
>I imagine something like
>
>"SELECT * FROM complicated_query(26,50)"
>
>or even
>
>"SELECT * FROM slice_query('SELECT foo,bar FROM quux',26,50);
>
>and while I could construct the query with the dbms_sql package,
>I'm not sure how to make the procedure or function return the rows.
>
>or is there a way to get Perl/DBI to understand dbms_output lines?
>
>Thanks in advance.
>
>
Received on Mon Jul 12 1999 - 05:15:35 CDT

Original text of this message

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