Quantcast
Channel: SQL Server Database Engine forum
Viewing all articles
Browse latest Browse all 12963

Getting Latest Date

$
0
0

Hi, 

I have this table:

ProductID|Product|EffectiveDate
1|Pencil|'2013-01-01'
2|Pencil|'2013-04-01'
3|Eraser|'2012-01-01'
4|Pen|'2014-02-01'

I want to get the latest record for each of the product, with this result:

ProductID|Product|EffectiveDate
2|Pencil|'2013-04-01'
3|Eraser|'2012-01-01'
4|Pen|'2014-02-01'

What is the most efficient way to do this?



cherriesh


Viewing all articles
Browse latest Browse all 12963

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>