Oracle column Alias - from keyword not found where expected

允我心安 提交于 2020-01-02 00:51:49

问题


SELECT col1 'COLUMN 1'
FROM TABLENAME

I am getting an error 'from keyword not found where expected'

How can you give column alias in Oracle 10g some examples are appreciated


回答1:


Use double quotes:

SELECT col1 "COLUMN 1" FROM TABLENAME



回答2:


Shepherdess is correct - you can't use single quotes here.

If the alias doesn't have spaces, you could just type the name without any quotes:

SELECT col1 column1 FROM TABLENAME



回答3:


Single quotes is not allowed here .Either you have to use double quotes or not quots between column1.Careful about column1 because it doesn't supported any spaces between column1.



来源:https://stackoverflow.com/questions/6220188/oracle-column-alias-from-keyword-not-found-where-expected

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