i have a table :
date number
2018-11-01 5
2018-11-30 7
2018-10-05 3
2018-10-28 1
2018-09-01 8
2018-09-05 9
how to sort the value of the last day for each month ?
i try :
$mysqli->query("
SELECT *
FROM stats
GROUP
BY YEAR(date)
, MONTH(date) desc
ORDER
BY date desc");
and also tryed with MAX() but without success :(
i would like to have in my while rows this result :
date number
2018-11-30 7
2018-10-28 1
2018-09-05 9
so just keep the value(number) of the last day for each month.
Thanks !