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

Home -> Community -> Usenet -> c.d.o.server -> Re: Need help with a query

Re: Need help with a query

From: Alan <alanshein_at_erols.com>
Date: Fri, 5 Apr 2002 14:24:28 -0500
Message-ID: <a8ktfi$t8qaf$1@ID-114862.news.dfncis.de>


Being that the Primary Key is a sequence, and assuming that the sequence is ascending, you should be able to:

SELECT MAX(Primary_key), Primary_key, varchar1, varchar2 FROM table
Group By Primary_key, varchar1, varchar2 ;

"Ryan Gaffuri" <rkg100_at_erols.com> wrote in message news:6757365f.0204031224.14871084_at_posting.google.com...
> I have 3 columns that are important.
>
> Primary_key
> VARCHAR1
> VARCHAR2
>
>
> This is for a master-detail form.
> The form is ordered by varchar1, varchar2
>
> I need to to select the last record. I cannot use the built in last
> record. Long story. Its causing problems. So I need to do the query
> myself.
>
> I am on forms 6i and Oracle 8i. I tried doing an order by in the where
> clause(that I thought I was supposed to be able to do in 8i?) in
> sqlplus and it did not recognize it.
>
> Also varchar2 can be null so this killed some subqueries I had going.
> The primary_key is based on a sequence.
>
> Thanks
Received on Fri Apr 05 2002 - 13:24:28 CST

Original text of this message

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