[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Query relational tables


Hi,

I have a table that contains ids for several other tables.  Setup is as
followed:

+--------------+------------------+------+-----+---------+----------------+
| Field        | Type             | Null | Key | Default | Extra          |
+--------------+------------------+------+-----+---------+----------------+
| id           | int(11)          |      | PRI | NULL    |auto_increment |
| title        | varchar(100)     | YES  |     | NULL    |                |
| rateID       | int(10) unsigned | YES  |     | NULL    |                |
| actorID      | int(10) unsigned | YES  |     | NULL    |                |
| actor2ID     | int(10) unsigned | YES  |     | NULL    |                |
| actor3ID     | int(10) unsigned | YES  |     | NULL    |                |
+--------------+------------------+------+-----+---------+----------------+

+---------+------------------+------+-----+---------+----------------+
| Field   | Type             | Null | Key | Default | Extra          |
+---------+------------------+------+-----+---------+----------------+
| actorID | int(10) unsigned |      | PRI | NULL    | auto_increment |
| first   | varchar(20)      | YES  |     | NULL    |                |
| middle  | varchar(20)      | YES  |     | NULL    |                |
| last    | varchar(20)      | YES  |     | NULL    |                |
+---------+------------------+------+-----+---------+----------------+

--------+------------------+------+-----+---------+----------------+
| Field  | Type             | Null | Key | Default | Extra          |
+--------+------------------+------+-----+---------+----------------+
| rateID | int(10) unsigned |      | PRI | NULL    | auto_increment |
| rating | varchar(15)      | YES  |     | NULL    |                |
+--------+------------------+------+-----+---------+----------------+


How can I query the movie tables so that it will get the names of the actors when each actor field may have a different name or may be null?

I am unable to query on more than one actor.

Thanks

Dee


---------------------------------------------------------------------
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 <suppressed>
To unsubscribe, e-mail <suppressed>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php


Mail converted by mhonarc 2.6.15
This archive provided courtesy of JSW4.NET, Internet Hosting Services for Small Business.