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 -> Select a single row

Select a single row

From: <brett.birschbach_at_cellcom.com>
Date: 20 May 2005 08:40:03 -0700
Message-ID: <1116603602.990452.90090@g14g2000cwa.googlegroups.com>


How can I rewrite the syntax for obtaining colC so that I still only get the record that was most recently added, but I dont have to query tabB twice?

SELECT colA,

       colB,
       (select colC
        from tabB
        where colD = 'FOO'
          and add_date = (select max(add_date)
                          from tabB
                          where colD = 'FOO')) colC
FROM tabA
where colA = 'FOO' Received on Fri May 20 2005 - 10:40:03 CDT

Original text of this message

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