日期:2014-05-17 浏览次数:20400 次
select COUNT(1) over(partition by a.userid) COUNT, g.remark,u.name, u.gridid
from action_base a, grid_base g, user_base u
where u.name like '%林%'
and a.endtime >= to_date('2013-01-01', 'yyyy-mm-dd')
and a.endtime <= (to_date('2013-01-17', 'yyyy-mm-dd') + 1)
and a.userid = u.id
and u.gridid = g.gridid
order by a.endtime
select sum(1) AS Count, g.remark,u.name, u.gridid
from action_base a, grid_base g, user_base u
where u.name like '%林%'
and a.endtime >= to_date('2013-01-01', 'yyyy-mm-dd')
and a.endtime <= (to_date('2013-01-17', 'yyyy-mm-dd') + 1)
and a.userid = u.id
and u.gridid = g.gridid
group by g.remark,u.name, u.gridid