title: SQL query to find the friends in a table
body: <p>I have two tables, <code>Users</code> and <code>Friends</code>. The tables look like:</p>
  
  <pre class="lang-none prettyprint-override"><code>USERS
  |  ID   |  Name   | 
  |  1    |  Sam    | 
  |  2    |  Harry  |         
  |  3    |  Vivi   |
  |  4    | sabrina |
  
  FRIENDS
  | UId   | FriendID| 
  |  1    |    2    |    
  |  2    |    3    |  
  |  4    |    1    | 
  |  5    |    4    | 
  |  1    |    3    |  
  </code></pre>
  
  <p>I need to find the names of all the friends for Sam. I tried doing the same using a <strong>Union</strong> in an SQL query, but I couldn't get the desired output. Can I possibly get the required output doing the same?</p>