ALIAS中的大写字母列名称不起作用

时间:2014-02-06 06:13:03

标签: sql select alias rename columnname

在以下选择语句名字中间名中,ALIAS不会出现。我希望此列标题为大写。

SELECT  dbo.Employee.Title AS SAL,
        dbo.Employee.FirstName AS FIRSTNAME,
        dbo.Employee.MiddleName AS MIDDLENAME
FROM dbo.Employee 

2 个答案:

答案 0 :(得分:1)

我试过了,它对我来说很好。但是,这是对SQL的建议更改,这可能有所帮助。

SELECT Title AS [SAL],
       FirstName AS [FIRSTNAME],
       MiddleName AS [MIDDLENAME]
FROM dbo.Employee 

答案 1 :(得分:0)

在PostgreSQL上使用双引号即可。

SELECT Title AS "SAL",
   FirstName AS "FIRSTNAME",
   MiddleName AS "MIDDLENAME"
FROM dbo.Employee