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

Home -> Community -> Usenet -> c.d.o.misc -> Explain Subsqueries

Explain Subsqueries

From: knez <knez_at_ix.netcom.com>
Date: Fri, 23 Oct 1998 19:45:35 -0400
Message-ID: <70r4ed$pj2@dfw-ixnews10.ix.netcom.com>


I was able to get this query to work but I don’t completely understand how it works. I used a furniture company as an example. I wanted to find everyone who had a FASTENER but did not have a CHAIR, LAMP or TABLE. Can someone explain how this works and if its the best way to return my answer

SELECT ACCT_NO_FURNITURE_INFO, PHONE_NO_CUST_INFO FROM FURNITURE_INFO A, CUST_INFO WHERE ACCT_NO_CUST_INFO = A.ACCT_NO_FURNITURE_INFO   AND STYLE_FURNITURE_INFO = ‘FASTENER’   AND CUST_STATUS_FURNITURE_INFO = ‘ACTIVE’ AND NOT EXISTS (SELECT 1   FROM FURNITURE _INFO B   WHERE A.ACCT_NO_FURNITURE_INFO = B.ACCT_NO_FURNITURE_INFO    AND STYLE_FUNITURE_INFO IN (‘CHAIR’,’LAMP’,’TABLE’)) Received on Fri Oct 23 1998 - 18:45:35 CDT

Original text of this message

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