我的数据库里已经得到了IP地址、访问时间。怎么根据这些统计总访问量,当前访问量和今天的访问量

解决方案 »

  1.   

    今天的访问量  这个简单呀,select count(*) from 带IP的表 where 时间=今天 (去掉重复的IP)
      

  2.   

    总访问量: select count(*) from table
    当前访问量:select count(*) from table where 时间 =当前
    今天的访问量: select count(*) from table where 时间 between 昨天  and 今天
      

  3.   

    select count(*) from ( Select distinct ip table)
      

  4.   

    截取出来的日期17/Feb/2012:16:48:14 +0800这种怎么格式化readStart = line.indexOf("[") + 1;
    readEnd = line.indexOf("]");
    kjpAnalyticalLogVO.setAnlAccessTime(line.substring(readStart,readEnd));