select * from note where noteKey = 1
此声明给出了以下错误。
ERROR: column "notekey" does not exist
LINE 1: select * from note where noteKey = 1
^
HINT: Perhaps you meant to reference the column "note.noteKey".
我试过note.noteKey,但得到了同样的错误。 (我顺便使用postico,而noteKey是表格的主键)。
声明可能有什么问题?
答案 0 :(得分:0)
您需要连接psql并运行\d note
。
如果显示该列名为noteKey
且大写为K
,那么您有两个选项
ALTER TABLE note RENAME COLUMN "noteKey" TO notekey;
"
进行查询。在PostgreSQL中,我们从不引用列名。这迫使他们对上限敏感。如果没有引用,他们会自动降低成绩。
此
select * from note where noteKey = 1
与
相同select * from note where notekey = 1
与
不同select * from note where "noteKey" = 1