List:General Discussion« Previous MessageNext Message »
From:samk Date:April 18 2008 5:09am
Subject:Re: A SQL Query Question
View as plain text  
See Thread at: http://www.techienuggets.com/Detail?tx=32975 Posted on behalf of a User

select userId, picture, MAX(datePosted) from A order by datePosted;





In Response To: 

Hello everyone,

I have a table A:

userId long
picture MeduimBlob
datePosted DateTime

A userId can have many pictures posted. I want to write a query that returns a distinct
userId along with the most recent picture posted. Can someone suggest an elegant and fast
query to accomplish this?

Thanks

Adam
Thread
A SQL Query Questionsamk18 Apr
  • Re: A SQL Query QuestionPeter Brawley18 Apr
Re: A SQL Query Questionsamk18 Apr