Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Mailing Lists -> Oracle-L -> SQL question: ...where x in (1,2,3)

SQL question: ...where x in (1,2,3)

From: Helmut Daiminger <hdaiminger_at_vivonet.com>
Date: Tue, 10 Oct 2000 16:00:10 -0700
Message-Id: <10645.118914@fatcity.com>


Hi!

I got a (hopefully) simple SQL question:

select distinct * from Tb_dept
where DeptID = 64
and CompanyID = 12345
and Status='AC'
and StoreLocID in (xx,yy,zz)

The values xx,yy, zz come from a sub-select statement like this:

  select storelocID from
  ( select count(*) as numstores from tbdept     where companyID = 12345
    and storelocID in (1,2)
    and status = 'AC'
    and Deptid = 64
    group by storelocID
  )

The question is: the number of rows returned from the sub-select may be different (i.e. just xx or xx and yy and zz).

How can I modify the first statement that I only get rows back that are in all StoreLocID's ???

Sounds confusing? Received on Tue Oct 10 2000 - 18:00:10 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US