SQL Query - First and Last Entry

You have to wrap your two statements into subqueries, because SQL doesn’t allow you to have two independent ORDER BY clauses on the “same” data (the result of your UNION).