$ 0 0 Move the calculation of REJ_CNT from the DERV2 subquery to the outer query. Also note that a CASE expression must return the same data type for all conditions (e.g. the numeric value will be implicitly converted to VARCHAR).
Move the calculation of REJ_CNT from the DERV2 subquery to the outer query.
Also note that a CASE expression must return the same data type for all conditions (e.g. the numeric value will be implicitly converted to VARCHAR).