Subject | Re: [firebird-support] select every nth row |
---|---|
Author | masotti |
Post date | 2009-04-21T10:36:18Z |
Hi Ron,
Ron Phelps ha scritto:
200000 records and seems working fine.
Changecommon table expression to select from your table.
Hope this can give another type of hint.
I've tried some with recursive, but at the moment i havn't found
anything usefgul.
create SEQUENCE seq_test;
commit;
select *
from (
select gen_id(seq_test,1) numrec, ll.ANNO, ll.FACOLTA, ll.PERIODO,
ll.PROTOCOLLO,
ll.CORSO, ll.INSEGNAMENTO, ll.DATA_LETTURA, ll.ETA, ll.PRIMASCH
from letture ll
) as ct1 (
recnum, anno, facolta, periodo, protocollo, corso, insegnamento,
data_lettura, eta, primascheda
)
where mod(ct1.recnum, 50) = 0;
commit;
drop sequence seq_test;
commit;
Ciao.
Mimmo.
Ron Phelps ha scritto:
> Have a database with a lot of data. To simplify plotting I would like toThis script output a record every 50. Tested it in a table with circa
> "filter" every nth row. Is there a way using a select statement to
> accomplish this?
>
200000 records and seems working fine.
Changecommon table expression to select from your table.
Hope this can give another type of hint.
I've tried some with recursive, but at the moment i havn't found
anything usefgul.
create SEQUENCE seq_test;
commit;
select *
from (
select gen_id(seq_test,1) numrec, ll.ANNO, ll.FACOLTA, ll.PERIODO,
ll.PROTOCOLLO,
ll.CORSO, ll.INSEGNAMENTO, ll.DATA_LETTURA, ll.ETA, ll.PRIMASCH
from letture ll
) as ct1 (
recnum, anno, facolta, periodo, protocollo, corso, insegnamento,
data_lettura, eta, primascheda
)
where mod(ct1.recnum, 50) = 0;
commit;
drop sequence seq_test;
commit;
Ciao.
Mimmo.