Connecting Tech Pros Worldwide Help | Site Map

Re: problem with column alias

 
LinkBack Thread Tools Search this Thread
  #1  
Old July 27th, 2008, 09:15 PM
Plamen Ratchev
Guest
 
Posts: n/a
Default 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
http://www.SQLStudio.com


  #2  
Old July 27th, 2008, 09:15 PM
Jan Hudecek
Guest
 
Posts: n/a
Default Re: problem with column alias

On 27 Čec, 23:06, "Plamen Ratchev" <Pla...@SQLStudio.comwrote:
Quote:
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
 

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search

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

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Popular Articles

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over 220,989 network members.