Results 1 to 3 of 3
  1. #1
    Join Date
    Dec 2003
    Posts
    4

    Unanswered: Using column aliases in expressions

    In MS Access I can do the following:

    select
    t.oid,
    t.a + t.b as C1,
    t.c + t.d as C2,
    C1 + C2 as C3,
    .....etc.....
    from t


    How to reference to aliases in Oracle views ?

  2. #2
    Join Date
    Sep 2002
    Location
    UK
    Posts
    5,171
    Provided Answers: 1

    Re: Using column aliases in expressions

    You can't do it like that, as you have found. You could do this though:

    select oid, c1, c2, c1+c2 as c3, ...
    from
    (
    select
    t.oid,
    t.a + t.b as C1,
    t.c + t.d as C2,
    .....etc.....
    from t
    );

  3. #3
    Join Date
    Dec 2003
    Location
    Oklahoma, USA
    Posts
    354
    Cool solution Andrew! I'll try it in some of my code too.

    JoeB

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •