57,062
社区成员
发帖
与我相关
我的任务
分享select cname `企业名称` ,sum(pvcount) pvcount ,sum(countip) ip from (select cname, count(id) as pvcount,COUNT(DISTINCT(ip)) as countip from tt where date_time between '2000-1-1' and '2000-1-3' group by cname,date_time) t group by cname;
+--------------+---------+------+
| 企业名称 | pvcount | ip |
+--------------+---------+------+
| 企业1 | 4 | 3 |
| 企业2 | 2 | 1 |
+--------------+---------+------+
2 rows in set (0.00 sec)