SqlExpr prev = null;
SqlCase scase = (SqlCase)arg;
for (Entry entry : scase.getEntries()) {
SqlExpr condition = entry.getCondition();
if (rep == null) {
rep = and(condition.clone(), isNull(entry.getResult().clone()));
prev = not(condition.clone());
}
else {
rep = or(rep, and(and(prev.clone(), condition.clone()), isNull(entry.getResult().clone())));
prev = and(prev, not(condition.clone()));