Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: Selecting from joined tables (simple question)
"Daniel Morgan" <damorgan_at_x.washington.edu> wrote in message
news:1075392927.103460_at_yasure...
> willy gates wrote:
>
> > Thanks for help with this one
> >
> > I have 2 tables
> >
> > DATA_STANDARD with columns ID and VALUE
> >
> > and
> >
> > DATA_EXTRA with column DS_ID and EXTRA_VALUE
> >
> > The idea is that extra information is stored in the DATA_EXTRA table
> > when required.
> >
> > How do I select all values from DATA_STANDARD where there is either no
> > entry in DATA_EXTRA or EXTRA_VALUE is zero.
> >
> > something like this?
> >
> > select ds.id from DATA_STANDARD ds, DATA_EXTRA de
> > where
> > ( ds.id not in ( select DS_ID from DATA_EXTRA ) )
> > or
> > (
> > --Join
> > ( ds.id = de.DS_ID )
> > and
> > ( de.extra_value is null )
> > )
> >
> > Why is this wrong?
> >
> > Thanks
>
> What is this "USe A Keyword" week?
>
> SQL> SELECT keyword FROM v$reserved_words
> 2 WHERE keyword IN ('ID', 'VALUE');
>
> KEYWORD
> ------------------------------
> VALUE
> ID
>
> SQL>
>
> Could you, perhaps, come up with worse names for your columns?
OK point taken but this was only a simplified example of my more complicated scenario and OK I should not have chosen those names.
BUT I have a feeling that the column name ID is autogenerated by Oracle Designer when there is no PK specified. Received on Fri Jan 30 2004 - 03:33:48 CST