why do i have different outcome list from below queries using postgresql?
query using alias in where clause:
select lower(left(first_name,1) || ‘.’ || last_name || ‘@xmail.com’) as email
from customer
where email like lower(‘%s%’);
without using the alias in where clause:
select lower(left(first_name,1) || ‘.’ || last_name || ‘@xmail.com’) as email
from customer
where lower(left(first_name,1) || ‘.’ || last_name || ‘@xmail.com’) like lower(‘%s%’);
i changed the letter ‘s’ for others, but it never returns the same result. The syntax must be wrong? What am i doing wrong?