POV-Ray : Newsgroups : povray.off-topic : Question for SQLers out there : Re: Question for SQLers out there Server Time
10 Oct 2024 21:17:14 EDT (-0400)
  Re: Question for SQLers out there  
From: Gilles Tran
Date: 12 Feb 2008 09:32:52
Message: <47b1ae14$1@news.povray.org>

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

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.