Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: Can I use an alias name is a where clause
On Wed, 09 Mar 2005 23:02:47 +0000, Lig <lignite_at_iol.ie> wrote:
>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?
That's just how it works.
>
>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
>
Why do that? You can cut and paste, can you?
>
>
>Cheers
>Lig
Please do not cross post to all groups you can spell. All groups are monitored and answered by the same small group of people. You're wasting both bandwith and people's time.
-- Sybrand Bakker, Senior Oracle DBAReceived on Wed Mar 09 2005 - 17:22:35 CST