Re: Marking a subset efficiently

From: Daniel Morgan <damorgan_at_exxesolutions.com>
Date: Mon, 28 Apr 2003 06:35:28 -0700
Message-ID: <3EAD2E20.EAF4E106_at_exxesolutions.com>


Nikolaus Rumm wrote:

> Hello,
>
> I have a SELECT-Statement with a complicated WHERE-clause that is
> based on set operators (UNION, MINUS, INTERSECT).
> The purpose of this SELECT-Statement is to get a subset S1 of a set S.
> So far so usual.
> Unfortunately I want to get back the *whole* set (S) including those
> records that are part of the subset S1. The members of S1 should be
> marked with a 1-value in a flag.
>
> Example:
> S = {A1, A2, A3, A4}
> S1 = {A2, A3}
>
> I want to get all members of S, where A2 and A3 have
> FULFILL_CONDITION=1 and A1, A4 have FULFILL_CONDITION=0.
>
> Of course it's possible to partition the result using set operators
> but this is inefficient, as the complicated subselect will be executed
> several times. How should I do it (DECODE ?) ? Any help is
> appreciated.
>
> Regards, Nikolaus

It would be a lot easier to help you if you posted your existing DML. My instinct would lead toward just including a literal but I would like a clearer view of what you are doing before going beyond that.

--
Daniel Morgan
http://www.outreach.washington.edu/extinfo/certprog/oad/oad_crs.asp
(remove one 'x' from my email address to reply)
Received on Mon Apr 28 2003 - 15:35:28 CEST

Original text of this message