Distinct on Multiple columns in Hive
Asked Answered
F

1

13

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?

Fleabite answered 13/3, 2014 at 12:16 Comment(1)
Yes, Please refer to following link on how to use distinct cwiki.apache.org/confluence/display/Hive/…Colville
C
10

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
Colourable answered 30/4, 2020 at 17:17 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.