gpt4 book ai didi

postgresql - CONCAT 函数在 postgres 10 中不起作用

转载 作者:行者123 更新时间:2023-11-29 12:51:49 25 4
gpt4 key购买 nike

select CONCAT(name, desc) from table; 

出现以下错误

 ERROR:  syntax error at or near "desc"
LINE 1: select CONCAT(name, desc) from theme;
^
SQL state: 42601
Character: 21

同样的查询适用于 sqlserver、hana 和 oracle?任何帮助将不胜感激

最佳答案

desc 是保留关键字,必须加引号:

select CONCAT(name, "desc") 
from the_table

如果您密切注意错误消息中的 ^,它恰好指向 desc 部分,表明这是问题所在,而不是 concat( ) 函数。

关于postgresql - CONCAT 函数在 postgres 10 中不起作用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/52219783/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com