title: Combining ORDER BY AND UNION in SQL Server
body: <p>How can I get first record of a table and last record of a table in one result-set?</p>
  
  <p>This Query fails</p>
  
  <pre><code>SELECT TOP 1 Id,Name FROM Locations ORDER BY Id
  UNION ALL
  SELECT TOP 1 Id,Name FROM Locations ORDER BY Id DESC
  </code></pre>
  
  <p>Any help?</p>