Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Oracle column Alias - from keyword not found where expected

Tags:

oracle10g

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

like image 356
kalls Avatar asked Jun 02 '11 20:06

kalls


2 Answers

Use double quotes:

SELECT col1 "COLUMN 1" FROM TABLENAME
like image 102
Shepherdess Avatar answered Oct 16 '22 22:10

Shepherdess


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
like image 4
Gerrat Avatar answered Oct 16 '22 22:10

Gerrat