AnMy table structure and some sample data (test table), as well as my desired output (results) are available example + expected resultshere of my request.
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.