|
|
Tom Austin wrote:
> 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
>
>
>
> Now, I would normally write a SQL statement like this:
>
> select L.Type from Person P, Limbs L where L.PersonIndex = P.Index and
> P.Name = 'Bones'
>
> This *works*, but somehow I feel that this is where the JOIN should come
> in.
>
>
> Should a JOIN be used here?
> Does it matter?
>
>
> Thanky..... Tom
>
>
So to make sure I understand correctly....
My SQL statement is OK, but not necessarily ANSI standard.
My SQL statement is likely less efficient than using JOIN.
depending on the DB being used
My SQL statement may not be supported on all DB engines. JOIN *should*
be supported on all DB engines.
I've tried learning JOINS before, but it never stuck.
I guess I learned it all wrong int he first place.
Does someone have some simple and clear examples on JOINS and where they
work?
Yes, there's plenty on the net, but I've tried it, only to not have it
stick.
Thanky.... Tom
Post a reply to this message
|
|