I got confused about the algorithm and way to get the latest index of Group by. I have a query like this.
SELECT hasil_kmbg AS RESULT,
EXTRACT(MONTH
FROM tgl_check) AS MONTH,
EXTRACT(YEAR
FROM tgl_check) AS YEAR
FROM perkembangan
WHERE no_pasien=11
GROUP BY MONTH,
id_kmbg DESC
and here is result of the query
|Result|Month|Year|
-------------------
|3 |1 |2013|
|1 |1 |2013|
|5 |1 |2013|
|1 |2 |2013|
|1 |3 |2013|
and so on
the question is, how I just get Result which is Result is 3 in Month 1? I didn't want to show other result int Month 1 except 3 (the latest, I order it by desc).