Radoslav
Radoslav

Reputation: 1812

Single fql query for "friend id" to display latest photos

I am looking for optimized FQL way getting latest photos per user_id, the only one I can think now is to get aid's (album id's) and query each aid for photos ... (this is lots of querying)

Upvotes: 0

Views: 538

Answers (1)

Anatoly Lubarsky
Anatoly Lubarsky

Reputation: 3036

You can use subquery, should be like so:

SELECT object_id, src_small
FROM photo
WHERE aid IN (SELECT aid FROM album WHERE owner = me())
ORDER BY created DESC LIMIT 1

hope this helps

Upvotes: 1

Related Questions