Question

If I write this query:

select Fname,Age*2 as Demo from Men where Demo = 5

then I get the error

ORA-00904 (Demo not identified )

How I can use it?

Was it helpful?

Solution

You don't need "as" in Oracle.

You simply write:

select fname, asge*2 demo from men;

However you cannot use the alias in the "where"-clause.

A Quote from a post on another site:

The technicality of it is that when the where clause and the group by clause are being executed, the select part of the query has not run and the alias has not been assigned. Since the order by is technically done after the select the aliases can be used.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top