Dienstag, 3. Mai 2016

Sequence Generator

Let assume you need to get a specific number of records as a data source. The actual content of the records does not matter much. You can achieve this be the following query.
with recursive R(n) as (
      values(1)
      union all
      select N + 1
        from R
       where N < 100 -- replace 100 with the number of records you want
)
select N from R
;

Keine Kommentare:

Kommentar veröffentlichen