I have a table with 3 columns (containing Integer values that assume only values from 0 to 10). I want extract, with a single query, a table with 1 column. This column must assume a value based on the following logic:
-
If one of these three columns has value 0 —-> the value of column of table generated by query must be 0 too.
-
If none of the last three columns has value 0 —-> the value of column must assume the value 1.
You are looking for
CASEconstruct orIFfunction:In this specific case you might also use the fact that any member being zero will zero the product:
Or