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: Tricky Dynamic 'Where' but not using Dynamic SQL

Re: Tricky Dynamic 'Where' but not using Dynamic SQL

From: Daniel Morgan <damorgan_at_x.washington.edu>
Date: Thu, 27 May 2004 22:37:30 -0700
Message-ID: <1085722657.597620@yasure>


A few comments interspersed and the balance snipped.

Chris Brady wrote:

> Please can someone advise me? Many thanks.
>
> I need to replicate this logic into an Oracle 8i SQL string without
> using functions or procedures or dynamic SQL.

Why? Why would you remove from discussion the best possible solutions to the problem?

> I have two fields to be used for the selection, both are usually Null
> but a few records have different values. These are the special cases
> that the logic is supposed to filter in a slightly more refined way.
>
> Typically:
>
> Field1 # Field2
> =======#=======
> HEDGE # I
> HEDGE # E
> ACTIV # I
> ACTIV # E
> Null # Null
>
> The start of the SQL is standard:
>
> SELECT * FROM TABLE WHERE
> GROUP BY ACCOUNT_ID;

> This is sufficient for all records where Field1 and Field2 are both
> Null.

How can an invalid SQL statement be 'sufficient'? You do not have any aggregating function so what is GROUP BY doing?

> Many thanks – CJB.

-- 
Daniel Morgan
http://www.outreach.washington.edu/ext/certificates/oad/oad_crs.asp
http://www.outreach.washington.edu/ext/certificates/aoa/aoa_crs.asp
damorgan_at_x.washington.edu
(replace 'x' with a 'u' to reply)
Received on Fri May 28 2004 - 00:37:30 CDT

Original text of this message

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