Is this possible?
I’m trying to do a SQL statement on an alias but getting an error…
SELECT
CASE PERSON_TYPE WHEN 'PER' THEN LAST_NAME
ELSE COMPANY_NAME
END AS FULLNAME, *
FROM PERSON
[WHERE FULLNAME LIKE '%AN%'] // Error FULLNAME - INvalid COlumn Name
otherwise, this is the alternative I’m using….
WHERE (LAST_NAME LIKE '%AN%') OR (COMPANY_NAME LIKE '%AN%')
Thanks
You have two solutions.
One is to pass the FULLNAME to the WHERE CLAUSE like this:
THe other is to make an INNER QUERY like this: