LightDB支持关键字作为列别名

在LightDB22.2及以前的版本中,关键字无法直接作为列别名,如果想要作为别名必须使用as或双引号“”。

lightdb@postgres=# select 3 type;

ERROR:  syntax error at or near "type"

LINE 1: select 3 type;

                 ^

 

lightdb@postgres=# select 3 int;

ERROR:  syntax error at or near "int"

LINE 1: select 3 int;

                 ^

 

lightdb@postgres=# select 3 as type;

 type

------

    3

(1 row)

 

lightdb@postgres=# select 3 as int;

 int

-----

   3

(1 row)

 

lightdb@postgres=# select 3 "int";

 int

-----

   3

(1 row)

在22.3版本的LightDB中,已经支持多数的关键字可以直接作为列别名使用而无需再使用as或双引号“”。

 

 

具体的关键字支持列表详见以下链接:

http://www.light-pg.com/docs/lightdb/13.8-22.3/sql-keywords-appendix.html

posted @ 2022-09-27 12:50  小小罗的背影  阅读(30)  评论(0编辑  收藏  举报