Community
Loading...
Posted inSQL
Microsoft
9 years ago

Create a generate_series table value function

Postgres has this function and it can be very useful.The generateseries(start, stop, step) will return a single column of table from start to stop incremented by step inclusively. (e.g. 1 to 10, step 2 will return 1,3,5,7,9). Postgres also offers an overload that supports date incremented by an interval, although that can be emulated effectively by::select dateadd(d,n,@myStartDate) from generateseries(0,100,1) f(n)
Completed
ProgrammabilitySuggestions
Company Response
Microsoft
Company Response
1 year ago

2 Comments

You must to comment
erac roze7 days ago
0 Reports0
Conor Cunningham2 years ago
0 Reports0