>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 skip records in the result set.
>
>I don't think that the answer matters.
>
>Given that FB doesn't have the notion of ROW_Number within a result set, I 
>don't see how the OP can filter to only see every nth row.

I thought this question was answered long ago (with MOD)... What about 
something like:

execute block returning(<resulting fields>) AS
declare variable i integer;
begin
  i = 0;
  for select <whatever> into <resulting fields> do
  begin
    i = i + 1;
    if (i = 2) then suspend;
    if (i = 5) then i = 0;
  end
end

I think this will return record 2, 7, 12 etc.(of course there would have to be 
an ORDER BY for the result to be repeatable.

Set
  • ... 'checkmail' check_m...@satron.de [firebird-support]
    • ... 'checkmail' check_m...@satron.de [firebird-support]
      • ... 'checkmail' check_m...@satron.de [firebird-support]
        • ... 'Saunders, Rich' greym...@mykolab.com [firebird-support]
    • ... Ann Harrison aharri...@ibphoenix.com [firebird-support]
      • ... 'Leyne, Sean' s...@broadviewsoftware.com [firebird-support]
        • ... Svein Erling Tysvær svein.erling.tysv...@kreftregisteret.no [firebird-support]
          • ... 'Leyne, Sean' s...@broadviewsoftware.com [firebird-support]
            • ... Thomas Beckmann thomas.beckm...@assfinet.de [firebird-support]
              • ... 'Leyne, Sean' s...@broadviewsoftware.com [firebird-support]
                • ... Svein Erling Tysvær svein.erling.tysv...@kreftregisteret.no [firebird-support]
                • ... Thomas Beckmann thomas.beckm...@assfinet.de [firebird-support]
                • ... Thomas Beckmann thomas.beckm...@assfinet.de [firebird-support]
                • ... Mark Rotteveel m...@lawinegevaar.nl [firebird-support]
                • ... Svein Erling Tysvær svein.erling.tysv...@kreftregisteret.no [firebird-support]

Reply via email to