mysql distinct关键字(hive待确认)

select a,b from tab ; 会按照 a,b两个字段进行去重。

MySQL DISTINCT with multiple columns
You can use the DISTINCT clause with more than one column. In this case, MySQL uses the combination of values in these columns to determine the uniqueness of the row in the result set.

  

参考:https://www.mysqltutorial.org/mysql-distinct.aspx

 

hive去重规则同上mysql:

 

 

参考;https://cwiki.apache.org/confluence/display/Hive/LanguageManual+Select#LanguageManualSelect-ALLandDISTINCTClauses

posted @ 2020-01-16 15:33  bf378  阅读(166)  评论(0编辑  收藏  举报