how to do group by in HIVE
<p>I'm writing a hive query in which I need to group by a few field however I need to select some other fields besides those exist in the group by statement. That is,</p>

<pre><code>select A,B,C from table_name GROUP BY A,B
</code></pre>

<p>HIVE complains and says <code>Invalid table alias or column reference C</code>. It requires me to put <code>C</code> in the GROUP BY part but that changes my logic. How can I resolve this issue?</p>