def high_error_days(limit=1):
    """
    Gets the list of days with error rates above the limit
    :param limit: The percent threshold for finding a day that has too many
                   errors. Default 1.
    :return: The query string
    """
    return """
        SELECT Round((errors_per_day.error_count::numeric /
                (errors_per_day.error_count +
                 successes_per_day.success_count) * 100),2)
            AS error_percent, successes_per_day.date AS date
        FROM successes_per_day, errors_per_day
        WHERE successes_per_day.date = errors_per_day.date
          AND (errors_per_day.error_count::numeric /
              (errors_per_day.error_count +
               successes_per_day.success_count) * 100) >= {}
        ORDER BY date;
    """.format(limit)