I need to ask how can use Alias in Select Query,
I need this
SELECT (Complex SubQuery) AS A, (Another Sub Query WHERE ID = A) FROM TABLE
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.
You cannot do this:
You can however do this:
Or
The problem is that you cannot refer to aliases like this in the SELECT and WHERE clauses, because they will not have evaluated by the time the select or where part is executed.
You can also use a
havingclause, but having clauses do not use indexes and should be avoided if possible.