gpt4 book ai didi

postgresql - Postgres - 转义列名中的问号 (?)

转载 作者:行者123 更新时间:2023-11-29 12:02:39 32 4
gpt4 key购买 nike

我继承的 Postgres 数据库中的一列名称中有一个问号。

当我尝试选择它时,它会抛出一个错误

> select confirmed? from user_purchases;

ERROR: column "confirmed" does not exist
LINE 1: select confirmed? from user_purchases;
^
HINT: Perhaps you meant to reference the column "user_purchases.confirmed?".

我也试过用反引号(`confirmed?`)和引号(“confirmed?”)选择它,但出现了同样的错误。

如何选择该字段?

谢谢!

最佳答案

使用双引号:

 select "confirmed?" from user_purchases;

DEMO

关于postgresql - Postgres - 转义列名中的问号 (?),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48588922/

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