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?
Latest pic for user N:
SELECT userID,
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
See Thread at: http://www.techienuggets.com/Detail?tx=32975 Posted on behalf of
a User
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