Hi, I have a table used for generating stats (In fact it is phpTracker)
What I am trying to do is to generate the 1st page visited and the last paged visited, per session, but grouped together. i.e. request_time Session referer_uri 21/09/2002 12:51:08 7cf95b3162dac3b1ac6049b784f9c0f2 /bid/index.php 21/09/2002 12:51:51 7cf95b3162dac3b1ac6049b784f9c0f2 /bid/index.php?search=1 21/09/2002 12:51:58 7cf95b3162dac3b1ac6049b784f9c0f2 /bid/index.php?view=1 21/09/2002 12:52:28 7cf95b3162dac3b1ac6049b784f9c0f2 /bid/index.php?displayid=81 this would produce: First Page Count /bid/index.php 1 Last Page /bid/index.php?displayid=81 1 Now for multiple sessions request_time Session referer_uri 21/09/2002 12:51:08 7cf95b3162dac3b1ac6049b784f9c0f2 /bid/index.php 21/09/2002 12:51:51 7cf95b3162dac3b1ac6049b784f9c0f2 /bid/index.php?search=1 21/09/2002 12:51:58 7cf95b3162dac3b1ac6049b784f9c0f2 /bid/index.php?view=1 21/09/2002 12:52:28 7cf95b3162dac3b1ac6049b784f9c0f2 /bid/index.php?displayid=81 21/09/2002 17:24:19 cb0b6d40a0c9004ebbbf9312ca13ecc1 /bid/index.php 21/09/2002 17:24:50 cb0b6d40a0c9004ebbbf9312ca13ecc1 /bid/index.php?view=1 21/09/2002 17:25:10 cb0b6d40a0c9004ebbbf9312ca13ecc1 /bid/index.php?view=1 21/09/2002 17:25:38 cb0b6d40a0c9004ebbbf9312ca13ecc1 /bid/index.php?displayid=1 this would produce: First Page Count /bid/index.php 2 Last Page /bid/index.php?displayid=81 1 /bid/index.php?displayid=1 1 To add to this, some of the referrers have extra criteria which I want to ignore i.e. if the value of the referer_uri field is: /bid/index.php?displayid=1&nextpage=2, I want to ignore everything after, and including, the '&' symbol. I can do this using PHP, but I was wondering whether there is a way of doing some or all of the above in a MySQL Query? The main place where I fall down is when trying to COUNT upon the SUM of a set of values, especially when trying to GROUP BY it. MTIA Alexis --------------------------------------------------------------------- Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail <[EMAIL PROTECTED]> To unsubscribe, e-mail <[EMAIL PROTECTED]> Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php