Hi,
I'm having a bit of trouble structuring a query and am turning to the experts for help. I really appreciate the advice I've received over the last couple of days. Thanks.
OK...
Say I have the following two tables:
Table: Pages
id | time | page
0 300 index
0 310 index2
0 400 index3
1 510 index
1 575 index2
Table: Visit
id | pagelist
8 | 0
8 | 1
Ok, I think they're quite self explanatory but the Pages table contains each page a user has accessed and a time (the id is that visit number).
The Visit table contains a userid and an id link to the set of pages in that visit. I hope I've explained this OK.
Basically, what I'm looking for is a way to list this for each visit by a given user (e.g. no. 8):
Visit No. | Entry page | Exit page | Entry time | End time
I've got the first bit of the query worked out OK but I'm not sure how to get the highest time for each visit etc. Is this even possible - do I need to rethink my design?
Help greatly appreciated.
Russ