Robb:

http://dev.mysql.com/doc/mysql/en/JOIN.html

I am assuming all the information you need is student name + city
name. SELECT * FROM StudentTable AS s, CityTable AS c WHERE s.CityID =
c.CityID

Wes

On Wed, 8 Sep 2004 19:55:29 -0500, Robb Kerr
<[EMAIL PROTECTED]> wrote:
> Trying to get my mind around JOINs. Please help.
> 
> Scenario...
> StudentTable
>   Fields:
>   StudentID
>   StudentName
>   CityID
> 
> CityTable
>   Fields:
>   CityID
>   CityName
> 
> I will store personal information about the student in the first table. The
> second table contains information about the city. I relate the tables by
> entering the CityID from the CityTable into the CityID field in the
> StudentTable.
> 
> I can write the following SELECTs...
> 
> SELECT * FROM StudentTable
> SELECT * FROM CityTable
> 
> But, what's the correct syntax for using the JOIN statement to create a
> recordset with all of the information I need. Of course, this example is
> very simple and my "real" SELECTs will include WHEREs and ORDER BYs.
> 
> Thanx,
> --
> Robb Kerr
> Digital IGUANA
> Helping Digital Artists Achieve their Dreams
> ----------------------------------------------------
> http://www.digitaliguana.com
> http://www.cancerreallysucks.org
>

-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]

Reply via email to