cnxmax
asked on
Referencing Variable Selected Fields in Where Clause
I'm trying to get a variable field name created with "AS" in the select clause to work in the Where clause.
Is this possible? Is there another solution?
This code works without the Var_Priorty <= 2
Is this possible? Is there another solution?
This code works without the Var_Priorty <= 2
SELECT page_ID, page_title,
CASE
WHEN page_tag = 'howdy' THEN 1
WHEN page_tag = 'doo' THEN 2
ELSE 99 END As Var_Priority
FROM table_pages
WHERE page_ID > 100
AND Var_Priority <= 2
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER