Solve HAVING codegeneration problem.