Hello All,
I am having a table called Withdrawals which has : Name, year, period, amount.
EX:
Name Year Period Amount
--------------------------------
Jim 2010 1 100
Jim 2009 4 99
Jim 2009 3 17
Kim 2007 2 234
Ryu 2008 5 555
I was stuck that I can't get the latest value for the name & amount which has the recent year with the latest period.
I tried to use the query:
select max(year), max(period), name from withdrawarls
But I got wrong results.
So, how can I get the correct values:
Jim, 2010, 1, 100
Kim, 2007, 2, 234
RYU, 2008, 5, 555.