I use generate_series to insert values ββinto a table. And generate_series insert the values ββspecified in its range.
For example: for the following query
SELECT i AS id, i AS age, i AS house_number INTO egg FROM generate_Series(1,6) AS i;
we get the result:
id age house_number 1 1 1 2 2 2 3 3 3 4 4 4 5 5 5 6 6 6
But my problem is that I want to insert only to number 3 in the "age" column, and then start from 0 after 3:
id age house_number 1 1 1 2 2 2 3 3 3 4 1 4 5 2 5 6 3 6
Is it possible? Are there some random functions in generate_series()
that perform the same function?
source share