Oracle column Alias - from keyword not found where

2019-04-19 16:05发布

问题:

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.



标签: oracle10g