Re: problem with column alias

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Plamen Ratchev

    Re: problem with column alias

    You cannot use a column alias in the definition of another column. The
    solution is as you found to repeat the expression. Alternative solution is
    to define the first column in one CTE (or derived table) and then use the
    column in a second CTE.

    Also, it is good to define a valid column name (not a revered keyword) and
    then change it to whatever you want in the final SELECT (or client
    application).


    Plamen Ratchev


  • Jan Hudecek

    #2
    Re: problem with column alias

    On 27 Èec, 23:06, "Plamen Ratchev" <Pla...@SQLStud io.comwrote:
    You cannot use a column alias in the definition of another column. The
    solution is as you found to repeat the expression. Alternative solution is
    to define the first column in one CTE (or derived table) and then use the
    column in a second CTE.
    >
    Also, it is good to define a valid column name (not a revered keyword) and
    then change it to whatever you want in the final SELECT (or client
    application).
    >
    Plamen Ratchev
    Thank you, you're probably right about that keyword..
    Jan

    Comment

    Working...