## Bug description

We have an issue in which the table of users for each cohort does not contain the same number of users as the table reports.

### Example
([Source](https://app.posthog.com/insights?startEntity=%7B%22actions%22%3A%5B%5D%2C%22events%22%3A%5B%7B%22id%22%3A%22user%20signed%20up%22%2C%22type%22%3A%22events%22%2C%22order%22%3A0%2C%22name%22%3A%22user%20signed%20up%22%7D%5D%2C%22new_entity%22%3A%5B%5D%7D&returningEntity=%7B%22events%22%3A%5B%7B%22id%22%3A%22%24pageview%22%2C%22name%22%3A%22%24pageview%22%2C%22type%22%3A%22events%22%7D%5D%7D&retentionType=retention_first_time&date_to=2020-04-05T12%3A59%3A36.001Z&period=w&display=ActionsTable&properties=%5B%7B%22key%22%3A%22id%22%2C%22value%22%3A71%2C%22type%22%3A%22cohort%22%7D%2C%7B%22key%22%3A%22%24current_url%22%2C%22value%22%3A%22www.posthog.com%22%2C%22operator%22%3A%22not_icontains%22%2C%22type%22%3A%22event%22%7D%2C%7B%22key%22%3A%22%24current_url%22%2C%22value%22%3A%22https%3A%2F%2Fposthog.com%22%2C%22operator%22%3A%22not_icontains%22%2C%22type%22%3A%22event%22%7D%2C%7B%22key%22%3A%22%24current_url%22%2C%22value%22%3A%22localhost%22%2C%22operator%22%3A%22not_icontains%22%2C%22type%22%3A%22event%22%7D%2C%7B%22key%22%3A%22%24current_url%22%2C%22value%22%3A%22127.0.0.1%22%2C%22operator%22%3A%22not_icontains%22%2C%22type%22%3A%22event%22%7D%2C%7B%22key%22%3A%22%24current_url%22%2C%22value%22%3A%220.0.0.1%22%2C%22operator%22%3A%22not_icontains%22%2C%22type%22%3A%22event%22%7D%5D&insight=RETENTION))

**Table shows 6 users in cohort:**
<img width="222" alt="" src="https://user-images.githubusercontent.com/5864173/102359528-867d9500-3f76-11eb-8134-50d0adcbd5b8.png">

**Persons list shows a lot more than 6 users in cohort:**
<img width="150" alt="" src="https://user-images.githubusercontent.com/5864173/102359599-9a28fb80-3f76-11eb-9cb8-61b37ddd4d95.png">


## Expected behavior
The persons list and the retention table should match.


## How to reproduce

See description above.

## Environment

Cloud, Clickhouse.

## Additional context

Currently blocking internal personas analysis.

#### *Thank you* for your bug report – we love squashing them!

ee/clickhouse/sql/retention/people_in_period.py
e.uuid as uuid,
        e.event as event
        FROM events e join (SELECT person_id, distinct_id FROM person_distinct_id WHERE team_id = %(team_id)s) pdi on e.distinct_id = pdi.distinct_id
        where toDateTime(e.timestamp) >= toDateTime(%(start_date)s) AND toDateTime(e.timestamp) <= toDateTime(%(end_date)s)
        AND e.team_id = %(team_id)s {returning_query} {filters}
    ) event
    JOIN (
        {first_event_sql}
    ) reference_event
        ON (event.person_id = reference_event.person_id)
    WHERE {trunc_func}(event.event_date) > {trunc_func}(reference_event.event_date)
    UNION ALL
    {first_event_default_sql}
) person_appearances
WHERE base_interval = 0
GROUP BY person_id
ORDER BY appearance_count DESC
LIMIT %(limit)s OFFSET %(offset)s
"""
REFERENCE_EVENT_PEOPLE_PER_PERIOD_SQL = """
SELECT DISTINCT 
{trunc_func}(e.timestamp) as event_date,
pdi.person_id as person_id,
e.uuid as uuid,
e.event as event
from events e JOIN (SELECT person_id, distinct_id FROM person_distinct_id WHERE team_id = %(team_id)s) pdi on e.distinct_id = pdi.distinct_id
where event_date = {trunc_func}(toDateTime(%(start_date)s))
AND e.team_id = %(team_id)s {target_query} {filters}
"""
DEFAULT_REFERENCE_EVENT_PEOPLE_PER_PERIOD_SQL = """