Added LAST for queries.