0

I was wondering if there is an option to simply generate a range of numbers from 1 to N in Netezza?

Let's say that N=5, then my result should be:

N
1
2
3
4
5

Thanks!

Kyoto
  • 53
  • 8

1 Answers1

5

select _v_vector_idx.idx where idx between 1 and 10;

Note: IDX range is 0-1023

Mark F
  • 271
  • 1
  • 1
  • Is there any option to increase range? For example to 5000? :) – Kyoto Dec 03 '21 at 09:42
  • 2
    /* The table _V_VECTOR_IDX returns the numbers 0..1024. We can just join the table to itself to generate 1M rows */ select val from (select ((t1.idx * 1024) + t2.idx) as val from _v_vector_idx t1 cross join _v_vector_idx t2) as list_of_one_million_numbers where val between 1 and 5000; – Mark F Dec 03 '21 at 21:13