只要列值中有特殊字符‘|’,我就想用双引号将选定的列条目括起来。
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 '%abc@abc.com%';
在上面的查询中,在true条件下,每当电子邮件包含|时,我想用双引号将电子邮件括起来。例如,如果电子邮件是a|bc@gmail.com,我希望它是"a|bc@gmail.com“。这样做有可能吗?
发布于 2021-08-29 11:42:43
显然Netezza确实有一个concat运算符。我们可以利用。||连接两个字符串。能够达到预期的输出效果
https://stackoverflow.com/questions/68666557
复制