select t.username, t.date, t.value
from MyTable t
inner join (
select username, max(date) as MaxDate
from MyTable
group by username
) tm on t.username = tm.username and t.date = tm.MaxDate
More Related Contents:
- Select first row in each GROUP BY group?
- Get top 1 row of each group
- Optimize GROUP BY query to retrieve latest row per user
- GROUP BY with MAX(DATE) [duplicate]
- How to SELECT the newest four items per category?
- Select top 10 records for each category
- Return row with the max value of one column per group [duplicate]
- SQL join: selecting the last records in a one-to-many relationship
- Fetch the row which has the Max value for a column
- Oracle SQL query: Retrieve latest values per group based on time [duplicate]
- Select info from table where row has max date
- SQL: Find the max record per group [duplicate]
- Simple Query to Grab Max Value for each ID
- Fetch the rows which have the Max value for a column for each distinct value of another column
- How to select id with max date group by category in PostgreSQL?
- Can I do a max(count(*)) in SQL?
- T-SQL: Selecting Column Based on MAX(Other Column)
- mySQL Returning the top 5 of each category
- Select a Column in SQL not in Group By
- How can I select rows with most recent timestamp for each key value?
- SQL query to get most recent row for each instance of a given key
- Selecting all corresponding fields using MAX and GROUP BY
- Optimize groupwise maximum query
- SQL query to select distinct row with minimum value
- SQL: getting the max value of one column and the corresponding other columns [duplicate]
- Get values from first and last row per group
- Select corresponding to row from the same table SQL Server
- How to select the first N rows of each group?
- Get most common value for each value of another column in SQL
- PostgreSQL: top n entries per item in same table