Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> What is this SQL statement doing?

What is this SQL statement doing?

From: Michael J. Moore <hicamel_at_home.com>
Date: Mon, 02 Apr 2001 01:02:31 GMT
Message-ID: <HcQx6.16338$ea6.1791238@news1.frmt1.sfba.home.com>

select a.name, lodging

    from worker a, workerskill b
where a.name = b.name(+)

    and b.name is NULL
    and b.skill(+) = 'SMITHY';

This is an example from a book. It selects all of the workers who do not have 'SMITHY' as a skill.

table worker is ( name, lodging) .... table skill is (name,skill)

The above select will yield the same results as ... select a.name ,lodging

    from worker a
where a.name NOT IN

      (select name
        from workerskill
        where skill = 'SMITHY')'

I DO understand an Outer Join, but
I don't understand why the first select statement works. I particularly don't
understand what the
"and b.skill(+) = 'SMITHY'"
is doing. Can anybody explain this to me or direct me to literature that would
explain it?

Thanks,
Mike Received on Sun Apr 01 2001 - 20:02:31 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US