开发者

Make a range in postgres

开发者 https://www.devze.com 2022-12-24 07:27 出处:网络
How can I make a range in a select in PostgreSQL? I\'d like to have this result: num --- 1 2 3 4 5 6 From a query like:

How can I make a range in a select in PostgreSQL? I'd like to have this result:

num
---
1
2
3
4
5
6

From a query like:

SELECT range(1,6) A开发者_如何转开发S num;


SELECT  *
FROM    generate_series(1, 6) num

https://www.postgresql.org/docs/current/functions-srf.html

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号