Distinct on Multiple columns in Hive

29,444

Yes, Hive does support distinct on multiple columns. You can do that by following

SELECT distinct col1, col2, col3 from TABLE

If you want to select distinct rows, you can use * instead

SELECT DISTINCT * FROM TABLE
Share:
29,444
Bhaskar Mishra
Author by

Bhaskar Mishra

Hi, A Passionate technologist who loves adventure and gadgets. Life is bout family , spirituality and yeah Science. Science has made the difference between Humans and Non Humans. I have used stackoverflow alot to get answers on C#, .net and sql and I would love to be an important contributor here.

Updated on July 09, 2022

Comments

  • Bhaskar Mishra
    Bhaskar Mishra almost 2 years

    Hi does Hive support distinct on multiple columns. like select distinct(a, b, c, d) from table. If not is there a way to achieve this?