Hi all,
Can you have a WHERE statement in a CASE clause, because I can't seem to get it to work. For instance:
SELECT
CASE
WHEN IBMREQD IN ('Y') THEN 'FOUND'
ELSE 'NOT'
END CASE
FROM SYSIBM.SYSDUMMY1
works fine, but:
SELECT
CASE
WHEN IBMREQD IN ('Y', 'N') THEN 'FOUND'
ELSE 'NOT'
END CASE
FROM SYSIBM.SYSDUMMY1
gives me back an error message - "The search-condition in a SEARCH-WHEN-CLAUSE is not valid."
Can you have a WHERE statement in a CASE clause, because I can't seem to get it to work. For instance:
SELECT
CASE
WHEN IBMREQD IN ('Y') THEN 'FOUND'
ELSE 'NOT'
END CASE
FROM SYSIBM.SYSDUMMY1
works fine, but:
SELECT
CASE
WHEN IBMREQD IN ('Y', 'N') THEN 'FOUND'
ELSE 'NOT'
END CASE
FROM SYSIBM.SYSDUMMY1
gives me back an error message - "The search-condition in a SEARCH-WHEN-CLAUSE is not valid."