如何在数据库中建立动态的字段
我有一个数据库ip是关于记录访问者的ip的有三个字段 id ip date
结构如下
id ip date
1 200.120.31.210 2005-7-14 7:10:22
2 100.69.200.21 2005-7-14 8:14:32
3 210.31.200.14 2005-7-15 9:00:14
......
我想做一个显示每天24小时的ip个数的asp程序 用表格的形式显示如下
0 1 2 3 4 5 6 7 8 9 。。。。23
2005-7-14
2005-7-15
2005-7-16
。。。。
2005-8-14
在用asp编程中用sql语句
insert into biao select count(ip) as ipshu from ip where year(date)=year(getdate()) and month(date)=month(getdate()) and day(date)=day(getdate()) group by hour(getdate())
将当天的每个小时的ip个数插入到表中但是要是从数据库里面读出数据库内容就比较困难了
因此我想要是能够动态建立当天的日期的字段应该就比较容易读取了,不知道怎么实现,请教高手多多指教,如果这个方法不可以的话,其他的方法也可以指出,多谢了