Compare two tables of data in HIVE
<p>I have to find out if data in both the tables is same for a given view_date. If same my SQL should return zero, else non zero.</p>

<pre><code>Table1/Table2 columns:

Source
view_date
count
start_date
end_date
</code></pre>

<p>I tried in the below way:</p>

<pre><code>SELECT *
FROM (
    SELECT count(*)
    FROM table1
    ) a
JOIN (
    SELECT count(*)
    FROM TABLE 2
    ) b
WHERE view_date = '05/08/2016'
    AND a.x != b.y;
</code></pre>

<p>But I am not getting the expected result. Could someone please help me?</p>