SQL query column does not exist error

天大地大妈咪最大 提交于 2019-12-11 09:50:52

问题


I'm totally new in this area please tell me how to fix my problem.

when I write this query "SELECT * FROM places" in my database everything is okay. However when I change it to "SELECT * FROM places WHERE eventId=2", I get error. Please look at this image.

as you can see, eventId column is exist. Why my query throws error?


回答1:


You've almost certainly added the column names in a case-sensitive environment. (PgAdmin comes to mind.) Lowercase them in that same environment to avoid the need to quote fields.

Or change your query to:

select * from places where "eventId" = 2


来源:https://stackoverflow.com/questions/20119646/sql-query-column-does-not-exist-error

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!