<?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 correlated subquery in hive in Archives of Support Questions (Read Only)</title>
    <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/correlated-subquery-in-hive/m-p/151008#M36060</link>
    <description>&lt;P&gt;How to use data from outer query in the inner query or subquery  in hive?I am trying to use ndo.FromDate and ndo.ToDate in the second JOIN but that would not work&lt;/P&gt;&lt;PRE&gt;LEFT JOIN 
Temp.NumberOfDaysOnline ndo
ON
ndo.sku = nr.sku
JOIN
gadb.gasessiondata gasessiondata
ON 
1=1
LEFT JOIN 
(
 SELECT SUM(gasessiondata.sessions) As visitsOnDaysSKUWasLive
 FROM 
 gadb.gasessiondata gasessiondata
 WHERE 
 gasessiondata.date &amp;gt;= ndo.FromDate
 AND 
 gasessiondata.date &amp;lt; ndo.ToDate
 ) AS visits
&lt;/PRE&gt;</description>
    <pubDate>Wed, 27 Jul 2016 14:30:57 GMT</pubDate>
    <dc:creator>simran_k</dc:creator>
    <dc:date>2016-07-27T14:30:57Z</dc:date>
    <item>
      <title>correlated subquery in hive</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/correlated-subquery-in-hive/m-p/151008#M36060</link>
      <description>&lt;P&gt;How to use data from outer query in the inner query or subquery  in hive?I am trying to use ndo.FromDate and ndo.ToDate in the second JOIN but that would not work&lt;/P&gt;&lt;PRE&gt;LEFT JOIN 
Temp.NumberOfDaysOnline ndo
ON
ndo.sku = nr.sku
JOIN
gadb.gasessiondata gasessiondata
ON 
1=1
LEFT JOIN 
(
 SELECT SUM(gasessiondata.sessions) As visitsOnDaysSKUWasLive
 FROM 
 gadb.gasessiondata gasessiondata
 WHERE 
 gasessiondata.date &amp;gt;= ndo.FromDate
 AND 
 gasessiondata.date &amp;lt; ndo.ToDate
 ) AS visits
&lt;/PRE&gt;</description>
      <pubDate>Wed, 27 Jul 2016 14:30:57 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/correlated-subquery-in-hive/m-p/151008#M36060</guid>
      <dc:creator>simran_k</dc:creator>
      <dc:date>2016-07-27T14:30:57Z</dc:date>
    </item>
    <item>
      <title>Re: correlated subquery in hive</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/correlated-subquery-in-hive/m-p/151009#M36061</link>
      <description>&lt;P&gt;&lt;A href="https://community.hortonworks.com/users/10486/simrank.html"&gt;@Simran Kaur&lt;/A&gt;&lt;/P&gt;&lt;P&gt;You need to use a join or a sub-query within the sub-query. You can access out query from inner query. It is the other way around and by design for any SQL-like language.&lt;/P&gt;</description>
      <pubDate>Tue, 27 Dec 2016 06:38:31 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/correlated-subquery-in-hive/m-p/151009#M36061</guid>
      <dc:creator>cstanca</dc:creator>
      <dc:date>2016-12-27T06:38:31Z</dc:date>
    </item>
  </channel>
</rss>

