title: SQL Server : merge two tables content in one view and order by
body: <p>I have two tables:</p>
  
  <ul>
  <li><code>dbo.clients</code> </li>
  <li><code>dbo.employee</code></li>
  </ul>
  
  <p>and I need to create a view which:</p>
  
  <ul>
  <li>merges names and surnames with those 2 tables (clients &amp; employee)</li>
  <li>sorts the output by surname descending</li>
  </ul>
  
  <p>At the moment I have this:</p>
  
  <pre><code>create view dbo.people
  as
      select top 100 
          imię, nazwisko 
      from klienci 
      order by nazwisko desc
  
      union all
  
      select top 100 
          imię, nazwisko 
      from pracownicy
      order by nazwisko desc
  </code></pre>
  
  <p>legend:</p>
  
  <ul>
  <li>imię = name</li>
  <li>nazwisko = surname</li>
  </ul>
  
  <p>but the output is wrong, because there are 2 different sorts instead of 1 of overall</p>
  
  <p>look at the screenshot:
  <img src="https://i.stack.imgur.com/nfje9.jpg" alt="enter image description here"></p>
  
  <p>I hope u will understand me, and help me :) </p>
  
  <p>Thanks</p>