Marking a subset efficiently

From: Nikolaus Rumm <nikolausrumm_at_hotmail.com>
Date: 28 Apr 2003 03:35:58 -0700
Message-ID: <e0fe462c.0304280235.532f3f87_at_posting.google.com>



Hello,

[Quoted] [Quoted] 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 Received on Mon Apr 28 2003 - 12:35:58 CEST

Original text of this message