My table structure and some sample data (test table), as well as my desired output (results) are available [here](https://dbfiddle.uk/?rdbms=postgres_9.5&fiddle=fc66b9df655473fb78ff2dadfd51f3e4).

When I do

```
SELECT distinct colony, min(date_check), max(date_check)
from test
where protection ='Y'
group by colony

```

I only detect 1 event by colony.

Should I use a function or is there another way ?

*ps : if you think of a better title to help users, don't hestitate, I struggled.*