Path: news.easynews.com!core-easynews!newsfeed1.easynews.com!easynews.com!easynews!news.he.net!news-hog.berkeley.edu!ucberkeley!newsfeed.stanford.edu!postnews1.google.com!not-for-mail
From: nikolausrumm@hotmail.com (Nikolaus Rumm)
Newsgroups: comp.databases.oracle.tools
Subject: Marking a subset efficiently
Date: 28 Apr 2003 03:35:58 -0700
Organization: http://groups.google.com/
Lines: 23
Message-ID: <e0fe462c.0304280235.532f3f87@posting.google.com>
NNTP-Posting-Host: 212.39.192.3
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 8bit
X-Trace: posting.google.com 1051526158 16125 127.0.0.1 (28 Apr 2003 10:35:58 GMT)
X-Complaints-To: groups-abuse@google.com
NNTP-Posting-Date: 28 Apr 2003 10:35:58 GMT
Xref: core-easynews comp.databases.oracle.tools:58662
X-Received-Date: Mon, 28 Apr 2003 03:35:32 MST (news.easynews.com)

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
