Informatica 中的解码函数

发布于 2025-01-16 22:09:15 字数 325 浏览 0 评论 0原文

谁能帮我在 Informatica 中为下面的 case 语句编写一个解码函数?

CASE WHEN Employee in ('210','220','230') and Score like '7%' THEN concat(SUBSTRING(Employee,1,2),'2')

WHEN Employee in ('210','220','230') and Score not like '7%' THEN concat(SUBSTRING(Employee,1,2),'1')

ELSE Employee END as New_Employee

谢谢!!

Can anyone please help me to write a decode function in Informatica for the below case statement?

CASE WHEN Employee in ('210','220','230') and Score like '7%' THEN concat(SUBSTRING(Employee,1,2),'2')

WHEN Employee in ('210','220','230') and Score not like '7%' THEN concat(SUBSTRING(Employee,1,2),'1')

ELSE Employee END as New_Employee

Thanks!!

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

堇年纸鸢 2025-01-23 22:09:15

您可以使用解码来测试多个条件,例如CASE WHEN。它的工作原理与情况完全相同。

DECODE( TRUE,
        Employee in ('210','220','230') and substr(Score,1,1) = '7', concat(substr(Employee,1,2),'2') ,
        Employee in ('210','220','230') and substr(Score,1,1) <>'7',concat(substr(Employee,1,2),'1'), 
Employee )

因此,它将检查第一个条件是否为真,如果是,它将退出,否则检查第二个,如果为真,它将退出,依此类推......

You can use decode to test out multiple conditions like CASE WHEN. It works exacly like case when.

DECODE( TRUE,
        Employee in ('210','220','230') and substr(Score,1,1) = '7', concat(substr(Employee,1,2),'2') ,
        Employee in ('210','220','230') and substr(Score,1,1) <>'7',concat(substr(Employee,1,2),'1'), 
Employee )

So, it will check if first condition is true, if yes it will exit else check second, if true, it will exit and so on ...

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文