本帖最后由 thexihexi0 于 2012-09-28 18:55:11 编辑

解决方案 »

  1.   

    select to_char(do_time, 'YYYY-MM-dd'), count(*)
    from do , users 
    where users.id=do.user_id   
    and to_char(do_time, 'YYYY-MM-dd')=to_char(registration_time, 'YYYY-MM-dd')
    and to_char(registration_time, 'YYYY-MM-dd') between '2012-09-20' and '2012-09-22'
    group by to_char(do_time, 'YYYY-MM-dd')
      

  2.   

    SELECT TO_CHAR(do_time,'YYYY-MM-dd'),COUNT(*)
    FROM do, users
    WHERE  users.id=do.user_id
    AND TO_CHAR(do_time,'YYYY-MM-dd')=to_char(registration_time,'YYYY-MM-dd')
    AND to_char(registration_time,'YYYY-MM-dd') BEWTEEN '2012-09-20' AND '2012-09-22'
    GROUP BY to_char(do_time,'YYYY-MM-dd');
      

  3.   

    按日期分组
    select to_char(do_time, 'YYYY-MM-dd'),count(*)
    from do,users where
    users.id=do.user_id   
    and to_char(do_time, 'YYYY-MM-dd')=to_char(registration_time, 'YYYY-MM-dd')
    group by to_char(do_time, 'YYYY-MM-dd')
      

  4.   

    select uid,count(*),to_char(registration_time, 'YYYY-MM-dd')
    from do , users where
    users.id=do.user_id   
    and to_char(registration_time, 'YYYY-MM-dd')=to_char(do_time, 'YYYY-MM-dd')
    group by uid
    按每天每个人操作进行统计(每天指注册日期)
      

  5.   

    select uid,count(*),to_char(registration_time, 'YYYY-MM-dd')
    from do , users where
    users.id=do.user_id   
    and to_char(registration_time, 'YYYY-MM-dd')=to_char(do_time, 'YYYY-MM-dd')
    group by uid,to_char(registration_time, 'YYYY-MM-dd')
    按每天每个人操作进行统计(每天指注册日期)