简体   繁体   English

如何使查询结果的列名大写

[英]How to make column name of query result in UPPERCASE

How to make column name of query result in UPPERCASE (Postgres)如何以大写形式制作查询结果的列名(Postgres)

SELECT USER_NAME, USER_AGE from table; 

Result结果

user_name用户名 user_age用户年龄
First第一的 123 123
Second第二 234 234

Expectation: Result column name to be in uppercase ( USER_NAME USER_AGE instead of user_name and user_age).期望:结果列名称为大写( USER_NAME USER_AGE而不是 user_name 和 user_age)。

You can create an alias:您可以创建别名:

SELECT user_name as "USER_NAME", 
       user_age as "USER_AGE" 
from table; 

For details on how identifiers are treated see the manual有关如何处理标识符的详细信息,请参阅手册

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM