I have following case statements in my SELECT clause, also I
have a group by clause…
So, Is it okay to specify UF.CONT_PID & UF.M_STATUS_CD in my
GROUP BY Clause ? I need to specify the entire CASE statement
in GROUP BY ?
CASE WHEN UF.CONT_PID IN
('04007005', '01019045','01019046') OR
(UF.M_STATUS_CD IN ('01', '02')
THEN
1
ELSE
0
END
Rather than repeat the expression, you could do: