select t.userid, count(t.id) num
from sso_access_log t
where 1 = 1
and t.access_time >= to_date('2009-10-12 ', 'yyyy-MM-dd ')
and t.access_time <= to_date('2010-11-08 ', 'yyyy-MM-dd ')
group by t.userid
order by num desc
from sso_access_log t
where 1 = 1
and t.access_time >= to_date('2009-10-12 ', 'yyyy-MM-dd ')
and t.access_time <= to_date('2010-11-08 ', 'yyyy-MM-dd ')
group by t.userid
order by num desc