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 '%firstname.lastname@example.org%';
In the above query in the true condition I want to surround email by double quotes whenever email contains | . For ex if email is email@example.com , I want it to be “firstname.lastname@example.org”. Is it possible to do that ?
Apparently Netezza does have a concat operator . we can use. || to concat two string . Was able to achieve the desired out put with this