Not sure about the title, but the scenario is that I have a table listing the login dates of users to a site:
login_dates
LoginID (PK)
LoginDate (Timestamp)
LoginUsername
With records such as:
1, 2016-02-20, johnsmith
2, 2016-02-19, maryjones
3, 2016-02-18, johnsmith
4, 2016-02-17, maryjones
I know I can use MAX to get the most recent LoginDate, e.g.
MAX (LoginDate) AS LastLoginDate
But is it possible to extract the most recent LoginDate for each username, i.e.
1, 2016-02-20, johnsmith
2, 2016-02-19, maryjones