简体   繁体   中英

IIF statement in SQL/ Informatica ( expression transformation) with two values

I have the following SQL statement which check for the presence of 000. But what if I want to check the presence of either 000 or 666? I tried using | but no luck.....

IIF(Field='000','TRUE','FALSE')

in使用。

IIF(Field in ('000','666'),'TRUE','FALSE')

What dbms are you using?

Anyways, I'll suggest CASE instead of iif and IN instead of || like this:

SELECT CASE WHEN Field in('000','666') then 'TRUE' else 'FALSE' end as Col1
FROM YourTable

EDIT:

For informatica, there are 1 of two options, Either use OR like this:

IIF(Field='000' or Field='666','TRUE','FALSE')

Or use IN like this:

IIF(Field in('000','666'),'TRUE','FALSE')

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM