Need to replace this CASE statement in Where clause with something else (not CASE...), AND/OR (?). Anyway, the task is to get rid of Case statement in Where clause but I am not seeing how. Does anyone have an idea?
FROM CA_Leaves CL
WHERE CL.C_Status = 'New'
AND 1 = CASE WHEN @i_PARAM1_field = @i_PARAM3_field THEN 1
WHEN @i_PARAM1_field <> @i_PARAM3_field AND CL.class_id = @Other_CL_Id THEN 1
Voldemar likes to play CHESS (and IS good at it!)