Imagine you have a User table for a twitter-like web application that looks like this: Username, Status Update, Date Updated (eg. Ann123, "Hi, I am at Startbucks!", 01/26/12 10:00:01). Write a query that selects only the latest status update for each user.
Selects only the latest status update for each user.
Here's the closest answer to above quiz:
SELECT * FROM ( SELECT * FROM `user` ORDER BY username, DateUpdated DESC ) AS u GROUP BY username
I believe you can find the better answer to this. Thanks
Credit goes to Tony.