hive> select * from temp;OK20180302Page1112ios20180302Page2113android20180303Page1117ios20180303Page2117ios20180304Page3138androidTime taken: 0.222 seconds, Fetched: 5 row(s)hive> select `date`,count(uid) as pv,count(distinct uid) as uv from temp group by `date`;OK201803022220180303212018030411Time taken: 7.692 seconds, Fetched: 3 row(s)
SQL如下select `date`,count(uid) as pv,count(distinct uid) as uv from temp group by `date`;