SELECT * FROM graphs WHERE sid=2 ORDER BY id DESC LIMIT 10;
Explanation: by default results in an ORDER BY are sorted by ascending (ORDER BY ASC). By specifying descending (DESC) they are sorted in reverse order, the LIMIT 10 then takes the top 10 results.