I want to filter the results, by not showing the same SAISON_ID
, but to choose the SAISON_ID
that have the most recent DATE_START
SELECT saison_id
, date_start, date_end FROM saison
This request give me this result :
saison_id date_start date_end
0 2018-01-05 2018-01-12
0 2019-01-19 2019-02-05
1 2018-01-15 2018-02-13
2 2018-02-17 2018-03-24
3 2018-03-25 2018-06-12
4 2018-06-13 2018-09-18
5 2018-07-05 2018-11-19
6 2018-08-28 2018-11-20
7 2018-11-21 2019-01-17
If I do that :
SELECT DISTINCT(saison_id), date_start, date_end FROM saison GROUP BY saison_id
I have this new result :
saison_id date_start date_end
0 2018-01-05 2018-01-12
1 2018-01-15 2018-02-13
2 2018-02-17 2018-03-24
3 2018-03-25 2018-06-12
4 2018-06-13 2018-09-18
5 2018-07-05 2018-11-19
6 2018-08-28 2018-11-20
7 2018-11-21 2019-01-17
How can I get this instead ? (look the saisonID
0)
saison_id date_start date_end
0 2019-01-19 2019-02-05
1 2018-01-15 2018-02-13
2 2018-02-17 2018-03-24
3 2018-03-25 2018-06-12
4 2018-06-13 2018-09-18
5 2018-07-05 2018-11-19
6 2018-08-28 2018-11-20
7 2018-11-21 2019-01-17