I have a table which looks like below:
id-----year-----month-----value
1-----2007--------9--------123
1-----2007--------8--------144
1-----2007--------7--------345
1-----2006-------12-------1448
3-----2007--------6--------123
3-----2007--------2--------144
3-----2006-------11--------345
3-----2006-------10-------1448
i need to get the highest year-month value of each id, e.g.
id-----year-----month-----value
1-----2007--------9--------123
3-----2007--------6--------123
how can i do it in sql?
thanks.
Our community of experts have been thoroughly vetted for their expertise and industry experience.
The Most Valuable Expert award recognizes technology experts who passionately share their knowledge with the community, demonstrate the core values of this platform, and go the extra mile in all aspects of their contributions. This award is based off of nominations by EE users and experts. Multiple MVEs may be awarded each year.
The Distinguished Expert awards are presented to the top veteran and rookie experts to earn the most points in the top 50 topics.