logo-MindMajix
s
sreelu 123

Posted on 24th July 2024|46 views

0
votes

Postgresql Generate Series

How to generate series in PostgreSQL?

1 answers
Answers
P
kumar san

Posted on 24th July 2024| views

The [start],[stop] will generate and stop series and [increment] is used to increment the sequence by that value.

Syntax:

generate_series([start], [stop], [intervel/increment]);

Generate series in PostgreSQL can be used to build a set in column-wise with a regular incrementation as provided in the syntax.

For example:

SELECT * FROM generate_series(1[start], 15[Stop], 2[Increment]);

Now you run SQL you get,

OUTPUT:

1

3

5

7

9

11

13

15

 

Write your answer

STILL GOT QUERIES?

Get a Live FREE Demo

  • Explore the trending and niche courses and learning maps
  • Learn about tuition fee, payment plans, and scholarships
  • Get access to webinars and self-paced learning videos
Name
Course *
Email *
Phone Number