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

Home -> Community -> Usenet -> c.d.o.misc -> Re: Query help

Re: Query help

From: DA Morgan <damorgan_at_psoug.org>
Date: Tue, 02 May 2006 11:12:56 -0700
Message-ID: <1146593581.957906@jetspin.drizzle.com>


gn_at_dana.ucc.nau.edu wrote:
> I am not sure how to write the following query:
>
> Simplified table structure:
>
> ID SENT DATE
> 123 Y 5/1/2006
> 124 N 5/2/2006
> 124 Y 5/1/2006
> 125 N 5/2/2006
>
> I want to return a row if SENT = 'N' AND also that ID has NEVER had a
> 'Y'
>
> So in the above example the only row I would want returned would be ID
> = 125
>
> The table structure and query are much more complicated than that but
> that is the part that I am unsure about.
>
> All help appreciated, thanks

The first thing you do is fix the structure of the table. Three columns with 2 of the 3 reserved words.

SELECT keyword
FROM v$reserved_words
WHERE keyword IN ('ID', 'SENT', 'DATE');

This is obviously school work so you should ask your instructor. If you write something that doesn't we will help you with hints but we don't do other people's homework.

Daniel Morgan
www.psoug.org Received on Tue May 02 2006 - 13:12:56 CDT

Original text of this message

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