PUB TABLE                                        EVENT TABLE   
|p_id|pub_name          |address         |        |eventid|date      
|host_id|
|13  |John Barleycorn's |1800 N. Lincoln |        |321    |2001-01-27 |
32    |
|26  |Harry Carry's     |300 N. Dearborn |        |198    |2001-02-21 |
0     |
|67  |Cubby Bear        |3500 N. Clark   |        |369    |2001-02-23 | 39   
|
|45  |Wrightwood Tap    |600 Wrightwood  |      
|21  |River Shannon     |3500 N. Clark   |      

  HOST TABLE                                       STOP TABLE
|host_id|host_name      |phone          |       |event_id|p_id          |sequence     
|| 
|39     |Pamela Anderson|562-698-5473   |       |321     | 13           |
2           |
|51     |Tom Cruise     |212-369-2391   |       |321     | 67           | 1           |
|32     |Sammy Sosa     |312-365-7777   |       |321     | 26           | 3           |
                                                |198     | 21           | 1           |
                                                |198     | 45           | 2           |
                                                |198     | 67           | 3           |
                                                |369     | 13           | 1           
|                                                 |369     | 21           | 2          
 |
                                                |369     | 45           | 3           
|                                         

I am trying to do a select that would allow me to display the following:

        ** UPCOMING PUB CRAWLS **

Event  
ID      Beginning       Ending          Date            Hosted By
321     Cubby Bear      Harry Carry's   01-27-01        Sammy Sosa
198     River Shannon   Cubby Bear      02-21-01        unassigned
369     John Barleycorn Wrightwood Tap  02-23-01        Pamela Anderson


My select statement below is not cutting it and I beginning to wonder if
what I want to do can be done with a select statement or a join.  If it
can some help me figure out how.  If it can' can someone suggest some
other way of going about it.

SELECT e.eventid, e.date, e.host_id, p.name h.name
FROM event e, pub p, host h, stop s
WHERE e.eventid=s.event_id
AND s.p_id=p.p_id
AND e.host_id=h.host_id

---------------------------------------------------------------------
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

Reply via email to