If you have OLAP functionality, use...
Code:
select col1, col2 ...
from (select col1, row_number()over() rn
from yourTable) aTempTable
where mod(rn,5) = 0
;
If you don't have OLAP functionality, use...
Code:
select col1, col2 ...
from (select a.col1, a.col2 ... , count(*) rn
from yourTable a
, yourTable b
where a.aUniqueIndexCol >= b.aUniqueIndexCol
group by a.col1, a.col2 ...
) aTempTable
where mod(rn,5) = 0
;
The second example would involve a slightly more complicated join if your table has a composite unique key (and if your table has no unique identifier, you're outta luck!)
Damian