79146091

Date: 2024-10-31 19:23:23
Score: 0.5
Natty:
Report link

The right way to generate rows with redshift is to use WITH RECURSIVE CTEs, like that:

with recursive t(n) as (
  select 0::integer
  union all
  select n+1 from t where n <= 100
)
select n*2 as two_times_n from t;

You can join t with whatever real table you want.

See https://docs.aws.amazon.com/redshift/latest/dg/r_WITH_clause.html

Reasons:
  • Low length (0.5):
  • Has code block (-0.5):
  • Low reputation (0.5):
Posted by: Jim