Painkiller
Programmer
Hi all,
I have the following problem: we have a datbase where the ip adresses of the people visiting our website are stored, together with the time at which the website is visited. Table looks like this:
ID Date IP
1 2003-02-13 09:41:48.463 194.151.67.130
2 2003-02-13 09:41:54.383 194.151.67.130
3 2003-02-13 09:42:47.043 195.121.73.78
5 2003-02-13 09:54:28.993 212.61.38.106
6 2003-02-13 09:56:00.840 212.61.38.106
7 2003-02-13 09:56:36.120 212.61.38.106
I need to write a stored procedure that returns the counts of the visits per IP-adress, but so that consequetive visits from an IP-adress within 2 hours are only counted as 1 visit. The last part of this problem has got me stumped. Anybody know a way to tackle this problem?
I have the following problem: we have a datbase where the ip adresses of the people visiting our website are stored, together with the time at which the website is visited. Table looks like this:
ID Date IP
1 2003-02-13 09:41:48.463 194.151.67.130
2 2003-02-13 09:41:54.383 194.151.67.130
3 2003-02-13 09:42:47.043 195.121.73.78
5 2003-02-13 09:54:28.993 212.61.38.106
6 2003-02-13 09:56:00.840 212.61.38.106
7 2003-02-13 09:56:36.120 212.61.38.106
I need to write a stored procedure that returns the counts of the visits per IP-adress, but so that consequetive visits from an IP-adress within 2 hours are only counted as 1 visit. The last part of this problem has got me stumped. Anybody know a way to tackle this problem?