我正在尝试select在 PostgreSQL 中运行基本查询,但在使用列别名时遇到问题。我试图创建别名,randomfield As [Space In Name]但它给出了一个错误
错误:“[”处或附近的语法错误
第 2 行:randomfield As [Space In Name]
而且我还尝试使用不带括号的别名,但这也出现了错误。你如何用空格别名Postgresql?
Select randomfield As [Space In Name]
From saledata
Run Code Online (Sandbox Code Playgroud)
带有特殊字符的标识符在 SQL 中需要双引号:
SELECT randomfield AS "Space in Name" FROM saledata
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
1597 次 |
| 最近记录: |