How we can create alias of a column in table in SQL Server?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Creation of aliases is very easy
Another thing is usage of the aliases, you must remember that the aliases are available after projection (select) this mean that you can’t use those aliases in
FROM, WHERE, GROUP BY, HAVINGsections. Is allowed only inORDER BY.EDIT: Usage of aliases
Tables:
Wrong statement:
We use in WHERE section column that is not available on this level.
To solve this we have two options
Option One – We do the calculation in where statement
Option Two – We create a temporary table