一兼蕊、在用group by 時,select 中的字段要么出現(xiàn)在聚合函數(shù)中,要么出現(xiàn)在group by中产禾,不能獨立于兩者外。例如:
select id,deal_id,price,max(date)
from order
where date>'2017-08-01'
group by id,deal_id,price
二妄痪、在group by 后面跟having時楞件,having后只能跟原函數(shù)不能跟別名(spark數(shù)據(jù)查詢)。