Re: Difference b/w 2 ways of fetching record

From: Jim Kennedy <kennedy-down_with_spammers_at_attbi.com>
Date: Thu, 13 Feb 2003 15:30:06 GMT
Message-ID: <2SO2a.89308$tq4.3669_at_sccrnsc01>


see asktom.oracle.com for ranges. You do not need temporary tables. faster to just run the query.
Jim

--
Replace part of the email address: kennedy-down_with_spammers_at_attbi.com
with family.  Remove the negative part, keep the minus sign.  You can figure
it out.
"Praveen" <spraveen2001_at_yahoo.com> wrote in message
news:98d8ec76.0302130059.7f5a0e69_at_posting.google.com...

> Hi All,
>
> I have a USR table with username,first_name,last_name,nick_name and
email_address
> columns. Here the requirement is to fetch records in ranges like
1-100,101-201...
> and so on. I have done this using two(2) ways, They are:
>
> 1.
>
> select username,first_name,last_name,nick_name,email_address from (
> select rownum recno,first_name,,last_name,nick_name,email_address
> from USR) where recno >= 1 and recno < 101;
>
> 2. In this case, I created a GLOBAL TEMPORARY TABLE called TMP_USR with
>
> seq_id,username,first_name,last_name,nick_name and email_address columns.
>
> Insert into tmp_usr(
> seq_id,username,first_name,last_name,nick_name,email_address)
> select rownum,username,first_name,last_name,nick_name,email_address
> from USR;
>
> then,
> select username,first_name,last_name,nick_name,email_address
> from TMP_USR where seq_id >=1 and seq_id < 101;
>
> Here, which approach is best one, can anyone sugges me?
>
> Thanks in Advance,
> Praveen
Received on Thu Feb 13 2003 - 16:30:06 CET

Original text of this message