RE: [firebird-support] Skip records

2014-07-29 Thread Svein Erling Tysvær svein.erling.tysv...@kreftregisteret.no [firebird-support]
Thomas, I usually solve this kind of problem with recusive CTEs providing a counter for the records returned, thus a simple select statement can nicely filter on this kind of property without row numbers functionality. Can you provide an example, please. I, for one, can't imagine how a CTE

Re: [firebird-support] Skip records

2014-07-29 Thread Thomas Beckmann thomas.beckm...@assfinet.de [firebird-support]
Oops, forgot the ordering and of course, it can be optimized like this: with recursive CTE_NR as (select 1 as NR, t.ID, (select first 1 skip 5 t1.ID from TBL t1 where t1.ID t.ID order by t1.ID) as NXT from (select first 1 t.ID from TBL t order by t.ID) t union all select NR

Re: [firebird-support] Skip records

2014-07-29 Thread Mark Rotteveel m...@lawinegevaar.nl [firebird-support]
On 29-7-2014 09:47, Svein Erling Tysvær svein.erling.tysv...@kreftregisteret.no [firebird-support] wrote: Don't know whether windowing functions can be used in the WHERE clause, but when Firebird 3 is released, it would be tempting to try things like WHERE MOD(ROW_NUMBER() OVER (ORDER BY

Re: [firebird-support] Skip records

2014-07-28 Thread Ann Harrison aharri...@ibphoenix.com [firebird-support]
On Jul 22, 2014, at 9:47 AM, 'checkmail' check_m...@satron.de [firebird-support] firebird-support@yahoogroups.com wrote: I would like to read every n record, depending on number of records. Do you care if your results are repeatable? If so, you'll have to sort all the records then skip

RE: [firebird-support] Skip records

2014-07-28 Thread 'Leyne, Sean' s...@broadviewsoftware.com [firebird-support]
Ann, On Jul 22, 2014, at 9:47 AM, 'checkmail' check_m...@satron.de [firebird- support] firebird-support@yahoogroups.com wrote: I would like to read every n record, depending on number of records. Do you care if your results are repeatable?  If so, you'll have to sort all the records then

Re: [firebird-support] Skip records

2014-07-28 Thread Svein Erling Tysvær svein.erling.tysv...@kreftregisteret.no [firebird-support]
Ann, On Jul 22, 2014, at 9:47 AM, 'checkmail' check_m...@satron.de [firebird- support] firebird-support@yahoogroups.com wrote: I would like to read every n record, depending on number of records. Do you care if your results are repeatable? If so, you'll have to sort all the records then

RE: [firebird-support] Skip records

2014-07-28 Thread 'Leyne, Sean' s...@broadviewsoftware.com [firebird-support]
On Jul 22, 2014, at 9:47 AM, 'checkmail' check_m...@satron.de [firebird- support] firebird-support@yahoogroups.com wrote: I would like to read every n record, depending on number of records. Do you care if your results are repeatable? If so, you'll have to sort all the records then

RE: [firebird-support] Skip records

2014-07-28 Thread 'Leyne, Sean' s...@broadviewsoftware.com [firebird-support]
Thomas, I usually solve this kind of problem with recusive CTEs providing a counter for the records returned, thus a simple select statement can nicely filter on this kind of property without row numbers functionality. Can you provide an example, please. I, for one, can't imagine how a CTE

AW: [firebird-support] Skip records

2014-07-22 Thread 'checkmail' check_m...@satron.de [firebird-support]
and mod(id,:teiler)=0) it works Von: firebird-support@yahoogroups.com [mailto:firebird-support@yahoogroups.com] Gesendet: Dienstag, 22. Juli 2014 14:47 An: firebird-support@yahoogroups.com Betreff: [firebird-support] Skip records Hello, I would like to read every n record

AW: [firebird-support] Skip records

2014-07-22 Thread 'checkmail' check_m...@satron.de [firebird-support]
@yahoogroups.com [mailto:firebird-support@yahoogroups.com] Gesendet: Dienstag, 22. Juli 2014 14:47 An: mailto:firebird-support@yahoogroups.com firebird-support@yahoogroups.com Betreff: [firebird-support] Skip records Hello, I would like to read every n record, depending on number