I'm trying to use the label defined using AS in a WHERE clause. Is there any way to do that? This says "Invalid Column Name 'EmpStatus'". This is a simplified version of the query.
select case when New=1 then 'New Employee' when New=0 then 'Old Employee' else 'Employee' end As EmpStatus from Person
select *
from
(
select case when New=1 then 'New Employee'
when New=0 then 'Old Employee'
else 'Employee' end As EmpStatus
from Person
) as D
where EmpStatus like '%'