If I had a table like this:
Username Comment Date
-------------------------------
X test1 1-1-2015
X test2 1-3-2015
X test3 1-6-2015
Y test1 1-4-2015
Y test2 1-5-2015
Y test3 1-9-2015
and I need to get an output result like the below
Username Comment Date
----------------------------
X test3 1-6-2015
Y test3 1-9-2015
Output:
only retrieve record for X & Y based on the last date (get user name & comment for the last date that entered)
Is there is any way by using SQL Server 2014 to get result like this?