mysql distinct关键字(hive待确认)

大憨熊 提交于 2020-01-16 16:12:49

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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!