title: SQL - Retrieve field from sub-query
body: <p>I am writing a script using Oracle database 11g.</p>
  
  <p>I currently have several nested sub-queries. I need to retrieve a field from one of these sub-queries, but having some difficulty.
  My script currently is:</p>
  
  <pre><code>SELECT  a.PARTY_ID, a.PARTY_NAME, a.STATUS
          ,a.OBJECT_VERSION_NUMBER, a.PARTY_NUMBER
  FROM    HZ_PARTIES a
  WHERE   a.PARTY_TYPE = 'ORGANIZATION'
  AND     a.STATUS = 'A' and a.party_id = 4402
  AND     a.CREATED_BY_MODULE IN ('HZ_CPUI','TCA_V1_API','TCA_FORM_WRAPPER')
  AND     (a.PARTY_ID IN (SELECT b.PARTY_ID FROM HZ_CUST_ACCOUNTS b
             WHERE b.CUSTOMER_TYPE = 'R'
             AND b.CUST_ACCOUNT_ID IN (SELECT c.BILL_TO_CUSTOMER_ID FROM RA_CUSTOMER_TRX_ALL c
                      WHERE c.BILL_TO_CUSTOMER_ID IS NOT NULL
                      AND c.LAST_UPDATE_DATE &lt; SYSDATE-100)))
  </code></pre>
  
  <p>I am trying to select a field 'LAST_UPDATE_DATE' from the last of the nested sub-queries (the RA_CUSTOMER_TRX_ALL table).
  I've tried to include a select sub-query in the SELECT section. and the FROM section, but cannot link it into the last part of the sub-query.
  Can anyone assist?
  Cheers,
  RussH.</p>