Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Mailing Lists -> Oracle-L -> RE: SQL help
what about:
select * from t
where exists(select 1 from t where id=1) and exists(select 1 from t where id=2) and exists(select 1 from t where id=3);
kind regards,
Lex.
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
--
http://www.freelists.org/webpage/oracle-l
Received on Mon Oct 10 2005 - 11:09:55 CDT