postgresql 在 postgres 中创建一个范围

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/2515916/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-20 00:04:53  来源:igfitidea点击:

Make a range in postgres

sqlpostgresqlselectrangeintervals

提问by Yuri Kaszubowski Lopes

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

如何在 PostgreSQL 的选择中创建一个范围?我想要这样的结果:

num
---
1
2
3
4
5
6

From a query like:

从这样的查询:

SELECT range(1,6) AS num;