Stuck with a query... - Mailing list pgsql-general

From Geoff Caplan
Subject Stuck with a query...
Date
Msg-id 17538254036.20050308174712@variosoft.com
Whole thread Raw
In response to Re: About Access paths  (Greg Stark <gsstark@mit.edu>)
Responses Re: Stuck with a query...
List pgsql-general
Hi folks,

Sorry to ask a newbie SQL question but I'm struggling...

I have a website clickstream log:

request_id   session_id  sequence_num  url
100          xxx         1             /foo
101          xxx         2             /bar
102          xxx         3             /hoo
103          yyy         1             /foo
104          yyy         2             /bar

I need to count the number of times each url was an exit
page. An exit page is the highest sequence_num for each
session_id - 102 & 104 in the example. The report would look
like:

Exit pages:

/foo 4555
/bar 3204
/hoo 2337

etc...

Any pointers would be much appreciated!

------------------
Geoff Caplan
Vario Software Ltd
(+44) 121-515 1154


pgsql-general by date:

Previous
From: Michael Fuhr
Date:
Subject: Re: Move cursor
Next
From: Greg Stark
Date:
Subject: Re: Stuck with a query...