Subject Re: [ib-support] Interbase DB Design Question...newbie zone.....
Author Martijn Tonies
Hi Derek,

Read a book on SQL and look op the term JOIN.

Here's a go at it:

select car.make, owner.fname, owner.lname
from t_car car join t_owner owner on (car.fk_owner = owner.pk_ownerid)


With regards,

Martijn Tonies
InterBase Workbench - the developer tool for InterBase and Firebird
http://www.interbaseworkbench.com

Upscene Productions
http://www.upscene.com

"This is an object-oriented system.
If we change anything, the users object."


> Hello Everyone,
> Ok here goes. I have 2 tables 't_car' and 't_owner'.
> #
> 't_car'
> pk_vin
> make
> fk_owner
>
> 't_owner'
> pk_ownerid
> fname
> lname
>
> fk_owner refrences pk_ownerid
> #
>
> Now, I query 'select * from t_car'. I get in return
> the car vin #, car make and the foreign key value of
> the car owner.
> I understand how to use the foriegn key referential
> contraint to refer to the 'pk_ownerid' in the owner
> table. What I dont understand is how to get the values
> associated with that foriegn key.
> (ex...'fname','lname').
> So, here is the question, how do I get a cars vin #
> and the associated owners first name and last name?
> Thanks for the help,
> Derek T Basch
> Portland OR
>
>
>
>
>
> __________________________________________________
> Do You Yahoo!?
> Yahoo! Finance - Get real-time stock quotes
> http://finance.yahoo.com
>
>
> To unsubscribe from this group, send an email to:
> ib-support-unsubscribe@egroups.com
>
>
>
> Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
>
>