Easy rowid question

From: Russell Huntley <rhuntley_at_ix.netcom.com>
Date: 1996/04/11
Message-ID: <4kj4na$hvb_at_dfw-ixnews3.ix.netcom.com>#1/1


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. Received on Thu Apr 11 1996 - 00:00:00 CEST

Original text of this message