0

I want to surround the selected column entries with double quotes whenever there is a special character say ' | ' in the column value .

select 
case
when (p.email_address_text like '%|%')
      then 'true' -- where i want to surround the entry with double quotes
      else p.email
end as email
from dev_databse..tmp_new_student p where p.email_address_text like '%[email protected]%';

In the above query in the true condition I want to surround email by double quotes whenever email contains | . For ex if email is a|[email protected] , I want it to be "a|[email protected]". Is it possible to do that ?

0

1 Answer 1

1

Apparently Netezza does have a concat operator . we can use. || to concat two string . Was able to achieve the desired out put with this

Not the answer you're looking for? Browse other questions tagged or ask your own question.