<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>question Re: List the EMPLOYEES who are senior to king in Archives of Support Questions (Read Only)</title>
    <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/List-the-EMPLOYEES-who-are-senior-to-king/m-p/100518#M13402</link>
    <description>&lt;P&gt;&lt;A rel="user" href="https://community.cloudera.com/users/1146/bsuresh.html" nodeid="1146"&gt;@Suresh Bonam&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A rel="user" href="https://community.cloudera.com/users/1146/bsuresh.html" nodeid="1146"&gt;&lt;/A&gt;There are two ways to do it which I can think of at this moment. &lt;/P&gt;&lt;P&gt;1. You can write a couple of Pig statements to accomplish this.&lt;/P&gt;&lt;P&gt;2. You can try Hive query like below: (I won't recommended it normally for performance issues as Hive will first do a full cartesian product in this query, then filter, but since one side of the join only has one row, that's not an issue here.)&lt;/P&gt;&lt;PRE&gt;select emp1.ename, emp1.hiredate from emp emp1 join 
(select hiredate from emp where emp.ename='KING') emp2
where emp1.hiredate &amp;gt; emp2.hiredate;&lt;/PRE&gt;</description>
    <pubDate>Wed, 23 Dec 2015 17:58:04 GMT</pubDate>
    <dc:creator>pardeep_kumar</dc:creator>
    <dc:date>2015-12-23T17:58:04Z</dc:date>
    <item>
      <title>List the EMPLOYEES who are senior to king</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/List-the-EMPLOYEES-who-are-senior-to-king/m-p/100517#M13401</link>
      <description>&lt;P&gt;Hi guys,&lt;/P&gt;&lt;P&gt;The question is looking very simple.But i don't why i unable to get the solution.Think like we emp table similar to scott schema(oracle).I just want to write a query whose hiredate is more that hiredate of employee KING.&lt;/P&gt;&lt;P&gt;Here is the Query:&lt;/P&gt;&lt;P&gt;select ename,hiredate from emp e1 where e1.hiredate &amp;gt; (select hiredate from emp e2 where e2.ename='KING')&lt;/P&gt;&lt;P&gt;But unfortunately we have only support for 'IN' (Subqueries) in hive.How to achieve the requirement.&lt;/P&gt;</description>
      <pubDate>Wed, 23 Dec 2015 17:11:33 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/List-the-EMPLOYEES-who-are-senior-to-king/m-p/100517#M13401</guid>
      <dc:creator>bsuresh</dc:creator>
      <dc:date>2015-12-23T17:11:33Z</dc:date>
    </item>
    <item>
      <title>Re: List the EMPLOYEES who are senior to king</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/List-the-EMPLOYEES-who-are-senior-to-king/m-p/100518#M13402</link>
      <description>&lt;P&gt;&lt;A rel="user" href="https://community.cloudera.com/users/1146/bsuresh.html" nodeid="1146"&gt;@Suresh Bonam&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A rel="user" href="https://community.cloudera.com/users/1146/bsuresh.html" nodeid="1146"&gt;&lt;/A&gt;There are two ways to do it which I can think of at this moment. &lt;/P&gt;&lt;P&gt;1. You can write a couple of Pig statements to accomplish this.&lt;/P&gt;&lt;P&gt;2. You can try Hive query like below: (I won't recommended it normally for performance issues as Hive will first do a full cartesian product in this query, then filter, but since one side of the join only has one row, that's not an issue here.)&lt;/P&gt;&lt;PRE&gt;select emp1.ename, emp1.hiredate from emp emp1 join 
(select hiredate from emp where emp.ename='KING') emp2
where emp1.hiredate &amp;gt; emp2.hiredate;&lt;/PRE&gt;</description>
      <pubDate>Wed, 23 Dec 2015 17:58:04 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/List-the-EMPLOYEES-who-are-senior-to-king/m-p/100518#M13402</guid>
      <dc:creator>pardeep_kumar</dc:creator>
      <dc:date>2015-12-23T17:58:04Z</dc:date>
    </item>
  </channel>
</rss>

