* Thus wrote Marc Greenstock ([EMAIL PROTECTED]):
> Hi all,
> 
> Wondering if someone could help me with an sql statement
> 
> MySQL version 4.0.18
> 
> I have three tables:
>     1. visitor_data (Visitor_ID, IP Address)
>     2. visit_data (Visit_ID, Visitor_ID)
>     3. page_data (Page_ID, Visit_ID, Visitor_ID, URI)
> 
> If you look closely you can see the relationship in these tables and you
> might guess I'm tracking what a user is doing on this site.

This really should be asked on a mysql list.

select pg.Page_ID, pg.Visit_ID, pg.Vistor_ID, pg.URI
  from vistor_data vrd, visit_data vd, page_data pg
where vrd.Visitor_ID = vd.Visitor_ID
  and vd.Visit_ID = pg.Visit_ID

As loong as 
  vrd.Vistor_ID, vd.Visit_ID are unique
and
  pg.Visit_ID is indexed

You'll performance wont be an issue.


Curt
-- 
"I used to think I was indecisive, but now I'm not so sure."

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to