Column 'mary' does not exist

天涯浪子 提交于 2019-11-26 14:52:34

问题


i'm doing a simple query here and it returns that column 'Mary' does not exist:

SELECT  telephone.telephonenumber as tel
FROM    person, telephone
WHERE   person.idperson = telephone.idperson
AND person.personname = ‘Mary’;

Can someone explain what can be happening? I don't want Mary as a column, but as a value.

Thanks in advance, Gabriel


回答1:


Use plain single quotes to delimit a string literal 'Mary' not smart quotes ‘Mary’




回答2:


Make sure that you are quoting your string correctly.

From your snippet, I'd say that's the problem here since you're using something else than simple single quotes.



来源:https://stackoverflow.com/questions/13196572/column-mary-does-not-exist

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