47b1a492$1@news.povray.org...
> OK, I've heard a lot about inner joins and outer joins but don't really
> know them or how to use them.
>
> I've actually been using SQL for 10 years now, but never managed to
> completely figure this out.
>
>
> Lets say I have (2) tables - (2) column each
>
> Person Limbs
> Index Name PersonIndex Type
I'd do it a little differently ;)
Table:Persons
Person_code
Person_name
Table:Limbs
Limb_code
Limb_type
Table:Person_limbs
Person_code
Limb_code
The Person_limbs table make it possible to give a person a variable list of
limb types.
Now you want to list the names of persons who have limbs of the type "legs"
:
SELECT Person.Person_name
FROM (Limbs INNER JOIN Person_limbs ON Limbs.Limb_code =
Person_limbs.Limb_code) INNER JOIN Person ON Person_limbs.Person_code =
Person.Person_code
WHERE (((Limbs.Limb_name)="legs"));
G.
--
*****************************
http://www.oyonale.com
*****************************
- Graphic experiments
- POV-Ray, Cinema 4D and Poser computer images
- Posters
Post a reply to this message
|