Re: query issue

From: Mark D Powell <Mark.Powell_at_eds.com>
Date: 28 Jan 2004 06:49:30 -0800
Message-ID: <2687bb95.0401280649.623d7f8_at_posting.google.com>


"Guido Konsolke" <GK_at_oblivion.com> wrote in message news:<1075286028.798968_at_news.thyssen.com>...
> "curwen" wrote...
> > Hi,
> > I'm in deep struggle with query from a huge table:
> >
> > what I've got is a lot of records like:
> >
> > _______________
> > numb fk1
> > _______________
> > 1231456 61
> > 1231456 62
> > 1231456 63
> > 1231456 61
> >
> > from my view I should only get the last record:
> > __________
> > 123456 61
> >
> > last has to be intended as inserting order, there's not sorting
 defined on data
> > the table has also a progressive id generated by a sequence..
> >
> > I've tried the the following , but doesn't work:
> >
> > select distinct numb,fk1
> > from <table>
> >
> > can anybody help, please?
> > best regards
> > jc
>
> Hi jc,
>
> why don't you use the 'progressive id' you mentioned?
> Hint for free: MAX().
>
> hth,
> Guido

JC, there is no guarantee that the order that the rows display in is the same as the insert order since Oracle is going to look for and insert into blocks with free space in them. Guido, pointed you at the solution: you have to use the max progressive id for a numb fk1 value combination to find the last inserted value pair.

HTH -- Mark D Powell -- Received on Wed Jan 28 2004 - 15:49:30 CET

Original text of this message