select cno
from   orders
where  exists (select ono
               from   odetails
               where  odetails.ono = orders.ono and
                      odetails.pno = 10506) and
       exists (select ono
               from   odetails
               where  odetails.ono = orders.ono and
                      odetails.pno = 10507);
