Hi everyone, this is my first post so go easy on me!!
I'm relatively new to the DB2 world and am having a bit of an SQL problem.
Basically, i'm struggling to goup by the result of a case statement..
Here's the case statement:
Code:
(CASE WHEN PROD.PROB_DFLT_PCT_RES IS NOT NULL THEN PROD.PROB_DFLT_PCT_RES * 100
WHEN PROD.PRBL_DFLT_PCT IS NOT NULL THEN PROD.PRBL_DFLT_PCT
ELSE IP.PROB_DFLT_PCT END) AS PD_PCT
this gives me a number that's actually a dimension, when i include it in my group by i get an error:
Code:
SQL0206N "PD_PCT" is not valid in the context where it is used
Can anybody help me find a way around this?