Skip to content
Advertisement

SQL Function to Determine if a Set of Fields Meet Some Criteria

I’m working with a DB2 database, and was wondering whether a function exists that allows me to determine whether a set of columns meet some criteria.

I can simply use OR to accomplish this, however, I’m wondering whether there exists a more sophisticated way.

For example, this works:

But I am looking for SOME_FUNCTION as in the below:

The idea is to avoid stretching out the case statement if it is not needed. Any help would be great!

Advertisement

Answer

You can use exists instead of in:

User contributions licensed under: CC BY-SA
4 People found this is helpful
Advertisement