SQL查询列不存在错误 [英] SQL query column does not exist error

查看:121
本文介绍了SQL查询列不存在错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是这个领域的新手,请告诉我如何解决我的问题.

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

当我在数据库中编写此查询"SELECT * FROM places"时,一切正常. 但是,当我将其更改为"SELECT * FROM places WHERE eventId=2"时,会出现错误.请看这张图片.

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.

eventId列存在.为什么我的查询会引发错误?

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

推荐答案

几乎可以肯定,您在区分大小写的环境中添加了列名称. (PgAdmin浮现在脑海.)在相同的环境中将它们小写,以避免引用字段.

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.

或将查询更改为:

select * from places where "eventId" = 2

这篇关于SQL查询列不存在错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆