def _get_hou_version_filter(latest):
    """
    Get the right peace of sql query to filter by houdini versions, latest and
    previous
    """
    if latest:
        return """hmc.houdini_major_version = '{{ latest_hou }}'  """
    
    else:
        return """hmc.houdini_major_version <= '{{ previous_hou }}' """