Re: Easy rowid question

From: Yoram zilberberg <elric_dm_at_netvision.net.il>
Date: 1996/04/18
Message-ID: <NEWTNews.829885251.9453.elric_dm_at_dialup.netvision.net.il>#1/1


In Article<4krftt$al0_at_nnrp1.news.primenet.com>, <pmc_at_primenet.com> write:
> Path:

news.NetVision.net.il!psinntp!psinntp!psinntp!howland.reston.ans.net!swrinde!ga tech!newsfeed.internetmci.com!in2.uu.net!nntp.news.primenet.com!news.primenet.c om!pmc
> From: Patrick Connors <pmc_at_primenet.com>
> Newsgroups: comp.databases.oracle
> Subject: Re: Easy rowid question
> Date: 14 Apr 1996 11:25:01 -0700
> Organization: Primenet (602)395-1010
> Lines: 49
> Sender: root_at_primenet.com
> Message-ID: <
4krftt$al0_at_nnrp1.news.primenet.com>
> References: <4kj4na$hvb_at_dfw-ixnews3.ix.netcom.com>
> X-Posted-By: pmc_at_usr6.primenet.com
>
> Russell Huntley <rhuntley_at_ix.netcom.com> wrote:
> : I am trying to put a process in place that will retrieve a sample of
> : rows from an answer set.
 

> : I first tried:
 

> : select field1
> : from table1
> : where mod(rowid,3) = 0;
 

> : I thought this would work but returned 0 rows. After some research, I
> : discovered that if row 1 doesn't meet the "mod(rowid,3) = 0" criteria,
> : then row 2 will have a rowid of 1 and won't meet the criteria, etc...
 

> : One solution is to alter the table by adding a rowid_col column,
> : updating rowid_col with rowid, and then doing the mod(rowid_col,3) = 0.
 

> : Is there a better way???
 

> : Thanks, Russ.
>

From what I see you don't need rowid at all. since you just need something to work on use rownum, this is a number given , in a query to each row returned.

good luck

                Yoram Z. Received on Thu Apr 18 1996 - 00:00:00 CEST

Original text of this message