Is there a better way to do this?
SELECT * FROM mytable WHERE column=something ORDER BY date LIMIT 0,1;
EDIT:I have a table with columbs: ID Name Date. I want to get the most recent entry (using the date column) where Name is Bob.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
With no more information, we can’t tell. You could most likely use MIN/MAX in a subquery, but there’s no way to tell if it would be better or not.
I’m thinking about something like this :
P.S. I’m not a fan of SELECT *, it’s usually more readable if you type the column you are selecting.