Re: SQL help
- From: rjamya <rjamya@xxxxxxxxx>
- To: dubey.sandeep@xxxxxxxxx
- Date: Mon, 10 Oct 2005 12:13:14 -0400
with x as (select length(replace(translate('&1','1234567890',' '),' '))+1 c1
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 = b.c2
/
Raj
On 10/10/05, Sandeep Dubey <dubey.sandeep@xxxxxxxxx> 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 =
'MANDATORY';
- Follow-Ups:
- Re: SQL help
- From: GovindanK
- References:
- SQL help
- From: Sandeep Dubey
Other related posts:
- » SQL help
- » Re: SQL help
- » Re: SQL help
- » SQL help
- » RE: SQL help
- » RE: SQL help
- » Re: SQL help
- » RE: SQL help
- » SQL help
- » RE: SQL help
- » Re: SQL help
- » Re: SQL help
- » Re: SQL help
- » SQL help
- » Re: SQL help
- » RE: SQL help
- » Re: SQL help
- Re: SQL help
- From: GovindanK
- SQL help
- From: Sandeep Dubey