dbTalk Databases Forums  

Can I use an alias name is a where clause

comp.database.oracle comp.database.oracle


Discuss Can I use an alias name is a where clause in the comp.database.oracle forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Lig
 
Posts: n/a

Default Can I use an alias name is a where clause - 03-09-2005 , 10:08 AM






The following select statement yeilds an error message ORA-00904:
"Total": invalid identifier.

select t.a + t.b + t.c Total
from some_table t
where Total > 0

Why can't the alias Total be used in the Where clause?

Is there any workaround other than doing something horrible like below

select *
from (select t.a + t.b + t.c Total
from some_table t)
where Total > 0

Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.