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

Home -> Community -> Mailing Lists -> Oracle-L -> Re:Retrieval Query

Re:Retrieval Query

From: Wayne S Bellefeuille <wbellefe_at_allina.com>
Date: Tue, 11 Jul 2000 14:22:44 -0500
Message-Id: <10555.111711@fatcity.com>


Because Oracle 8i now allows an ORDER BY in a "dynamic" view (as we call them here), you could do the following:

SELECT po_price
  FROM (SELECT dtls.po_price

          FROM po_hdr hdr,
               po_dtls dtls
         WHERE hdr.po_num = dtls.po_num
           AND dtls.po_material = :literal
         ORDER BY hdr.po_date DESC)       
 WHERE rownum = 1;

Wayne Bellefeuille

____________________Reply Separator____________________
Subject: Retrieval Query
Author: <ORACLE-L_at_fatcity.com>
Date: 7/11/00 3:54 AM

Hi Experts

I have the header table

PO_NUM, PO_DATE and the detail table

PO_NUM, PO_MATERIAL, PO_PRICE. I want to take the unit price of a material which is bought recently
(latest purchase order date) ?

Thanks

Richard

-- 
Author: 
  INET: drichard_at_mtlindia.com

Fat City Network Services    -- (858) 538-5051  FAX: (858) 538-5051
San Diego, California        -- Public Internet access / Mailing Lists
--------------------------------------------------------------------
To REMOVE yourself from this mailing list, send an E-Mail message
to: ListGuru_at_fatcity.com (note EXACT spelling of 'ListGuru') and in
the message BODY, include a line containing: UNSUB ORACLE-L

(or the name of mailing list you want to be removed from). You may
also send the HELP command for other information (like subscribing).
Received on Tue Jul 11 2000 - 14:22:44 CDT

Original text of this message

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