views:

125

answers:

1

hi

i writ thie query:

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

i get error - ORA-00904 (Demo not identified )

how i can use it ?

thank's in advance

+3  A: 

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.

Filip Ekberg