select
a.name as aname,
a.numb as anumb
from t_a a
left semi join t_b b
on a.name=b.name;
结果:
注意: left semi join的 select子句中,不能有右表的字段
group by分组聚合
select dt,count(*),max(ip) as cnt from t_access group by dt;
select dt,count(*),max(ip) as cnt from t_access group by dt having dt>'20170804';
select
dt,count(*),max(ip) as cnt
from t_access
where url='http://www.edu360.cn/job'
group by dt having dt>'20170804';