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

原文地址:https://www.cnblogs.com/leodaxin/p/12201501.html