title: Hive nested query
body: <p>I have the following table <code>Emp</code> in hive consisting of employee along with their Supervisor's of a particular Company. As we know that the Supervisor's are also the employee and even they have a Supervisor above them.</p>
  
  <pre><code>employee,Supervisor
  a,b
  b,c
  c,d
  d,e
  </code></pre>
  
  <p>I need to write a hive query to find out the supervisor of employee (a) i.e (b) and Supervisor of (b) i.e (c).
  I tried using the below query but it throw's an error.</p>
  
  <pre><code>select *
  from Emp
  where employee = (select Supervisor from Emp where employee = "a");
  </code></pre>
  
  <p>Can anyone help me out with this</p>