Skip to content

Instantly share code, notes, and snippets.

@nvquanghuy
Created April 1, 2016 05:54
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nvquanghuy/47aaec07af605a222fd27c640277331e to your computer and use it in GitHub Desktop.
Save nvquanghuy/47aaec07af605a222fd27c640277331e to your computer and use it in GitHub Desktop.
create table nick(a varchar, b varchar, num integer);
insert into nick values ('a', 'a', 2), ('b', 'b', 1), ('c', 'c', 3);
with R as (
select a, b, generate_series(1, num) from nick
)
select a, b from R;
@autogeosystems
Copy link

wow best!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment