Friday, 23 August 2013

select price having max year in another column

select price having max year in another column

I have following select result
Code Price Year
1 200 2013
1 100 2012
2 250 2011
2 275 2012
2 300 2010

But I want following something like this with one extra column which hold
price based on maximum year,
Code Price Year ExPrice
1 200 2013 200
1 100 2012 200
2 250 2011 275
2 275 2012 275
2 300 2010 275

Sorry for bad English and wrong way for asking this question.

No comments:

Post a Comment