Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Distinct on Multiple columns in Hive

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?

like image 821
Bhaskar Mishra Avatar asked Mar 13 '14 12:03

Bhaskar Mishra


1 Answers

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
like image 104
Jaya Kommuru Avatar answered Nov 09 '22 10:11

Jaya Kommuru