From oracle-l-bounce@freelists.org  Mon Oct 10 11:15:21 2005
Return-Path: <oracle-l-bounce@freelists.org>
Received: from air891.startdedicated.com (root@localhost)
 by orafaq.com (8.12.10/8.12.10) with ESMTP id j9AGFLS9027932
 for <oracle-l@orafaq.com>; Mon, 10 Oct 2005 11:15:21 -0500
X-ClientAddr: 206.53.239.180
Received: from turing.freelists.org (freelists-180.iquest.net [206.53.239.180])
 by air891.startdedicated.com (8.12.10/8.12.10) with ESMTP id j9AGFIvX027918
 for <oracle-l@orafaq.com>; Mon, 10 Oct 2005 11:15:18 -0500
Received: from localhost (localhost [127.0.0.1])
 by turing.freelists.org (Avenir Technologies Mail Multiplex) with ESMTP id E5D231FA4C7;
 Mon, 10 Oct 2005 11:15:14 -0500 (EST)
Received: from turing.freelists.org ([127.0.0.1])
 by localhost (turing [127.0.0.1]) (amavisd-new, port 10024)
 with ESMTP id 04074-02; Mon, 10 Oct 2005 11:15:14 -0500 (EST)
Received: from turing (localhost [127.0.0.1])
 by turing.freelists.org (Avenir Technologies Mail Multiplex) with ESMTP id 5E3BA1FA56E;
 Mon, 10 Oct 2005 11:15:14 -0500 (EST)
DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws;
        s=beta; d=gmail.com;
        h=received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:references;
        b=lN0nNoDLncMxyCzlTMCuHOvSM4MJzcs0jPX4D3q81g8NK9v9MJgEoAynNQ48rOqWVnHgF4B95/2ZNk/4CwBOR/H1yXB7NhGFfv5pXBZFdCRk9j0wyHXMJfq9sbeeeBieVav4V3C8ym6Cx6AEVh1LH5bIKe0gSR9O2CttnslKu8c=
Message-ID: <9177895d0510100913v27e5e817w2aacf714d8b7aeac@mail.gmail.com>
Date: Mon, 10 Oct 2005 12:13:14 -0400
From: rjamya <rjamya@gmail.com>
To: dubey.sandeep@gmail.com
Subject: Re: SQL help
Cc: oracle-l@freelists.org
In-Reply-To: <bf2f74740510100853i1c3ea46as46317662530b86e8@mail.gmail.com>
MIME-Version: 1.0
Content-Type: multipart/alternative; boundary="----=_Part_30515_7329551.1128960794518"
References: <bf2f74740510100853i1c3ea46as46317662530b86e8@mail.gmail.com>
X-archive-position: 26643
X-ecartis-version: Ecartis v1.0.0
Sender: oracle-l-bounce@freelists.org
Errors-To: oracle-l-bounce@freelists.org
X-original-sender: rjamya@gmail.com
Precedence: normal
Reply-To: rjamya@gmail.com
X-list: oracle-l
X-Virus-Scanned: by amavisd-new-20030616-p9 (Debian) at avenirtech.net
X-mailscan-MailScanner-Information: Please contact the ISP for more information
X-mailscan-MailScanner: Found to be clean
X-MailScanner-From: oracle-l-bounce@freelists.org
X-Spam-Checker-Version: SpamAssassin 2.63 (2004-01-11) on 
 air891.startdedicated.com
X-Spam-Level: 
X-Spam-Status: No, hits=-4.0 required=5.0 tests=AWL,BAYES_00,HTML_MESSAGE 
 autolearn=ham version=2.63
------=_Part_30515_7329551.1128960794518
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable
Content-Disposition: inline

with x as (select length(replace(translate('&1','1234567890',' '),' '))+1 c=
1
from dual)
,y as (select count(*) c2 from t where id in (&1))
select t.*
from t, x a, y b
where id in (&1)
and a.c1 =3D b.c2
/


Raj

On 10/10/05, Sandeep Dubey <dubey.sandeep@gmail.com> wrote:
>
> Hi,
>
> I am having weekend hangover with seemingly simple sql requirement.
>
> create table t(id number);
> insert into t values(1);
> insert into t values(2);
> commit;
>
> I want to query this with an Id set. All values in the set should be
> there to return me any row.
> e.g.
> select * from t where id in (1,2); return 1 and 2
>
> If am serching for 1,2,3 if any one value is missing I should not get any
> data.
> e.g.
> select * from t where id in (1,2,3) should not return any row.
> How to rewrite the above query with (1,2,3) that should not return me any
> row.
> Thanks
>
> Sandeep
> --
> http://www.freelists.org/webpage/oracle-l
>



--
------------------------------
select standard_disclaimer from company_requirements where category =3D
'MANDATORY';

------=_Part_30515_7329551.1128960794518
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable
Content-Disposition: inline

<br>with x as (select length(replace(translate('&amp;1','1234567890','&nbsp=
;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; '),' '))+1 c1 from =
dual)<br>&nbsp;&nbsp;&nbsp; ,y as (select count(*) c2 from t where id in (&=
amp;1))<br>select t.*<br>&nbsp; from t, x a, y b<br>&nbsp;where id in (&amp=
;1)
<br>&nbsp;&nbsp; and a.c1 =3D b.c2<br>/<br><br><br>Raj<br><br><div><span cl=
ass=3D"gmail_quote">On 10/10/05, <b class=3D"gmail_sendername">Sandeep Dube=
y</b> &lt;<a href=3D"mailto:dubey.sandeep@gmail.com">dubey.sandeep@gmail.co=
m</a>&gt; wrote:
</span><blockquote class=3D"gmail_quote" style=3D"border-left: 1px solid rg=
b(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">Hi,<br><br=
>I am having weekend hangover with seemingly simple sql requirement.<br><br=
>
create table t(id number);<br>insert into t values(1);<br>insert into t val=
ues(2);<br>commit;<br><br>I want to query this with an Id set. All values i=
n the set should be<br>there to return me any row.<br>e.g.<br>select * from=
 t where id in (1,2);&nbsp;&nbsp;return 1 and 2
<br><br>If am serching for 1,2,3 if any one value is missing I should not g=
et any data.<br>e.g.<br>select * from t where id in (1,2,3) should not retu=
rn any row.<br>How to rewrite the above query with (1,2,3) that should not =
return me any row.
<br>Thanks<br><br>Sandeep<br>--<br><a href=3D"http://www.freelists.org/webp=
age/oracle-l">http://www.freelists.org/webpage/oracle-l</a><br></blockquote=
></div><br><br clear=3D"all"><br>-- <br>------------------------------<br>s=
elect standard_disclaimer from company_requirements where category =3D 'MAN=
DATORY';
<br>

------=_Part_30515_7329551.1128960794518--
--
http://www.freelists.org/webpage/oracle-l

