I need to retrieve the 10 most recently posted photos by a specific user using FQL.
SELECT pid, src, caption FROM photo WHERE aid IN (SELECT aid FROM album WHERE owner = $user) ORDER BY created DESC LIMIT 10;
owner field isn’t indexed
photo table, so we need to
make a subquery into the
table to find photos owned by a specific user.
ORDER BY and
LIMIT clauses can be applied to any of the
queries in this chapter to order and/or constrain the result