(distinct(a)) da, max(b+c), avg(d) from t_distinct); explain (costs off, nodes off) select distinct db from (select count(distinct(b)) db, max(a-c), avg(d) from t_distinct); select distinct db from (select 