select id, url, images, Total from ( select * from temp order by id desc limit 10 ) last10 order by Total desc;