Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.misc -> Re: query on last inserted record.....please help
Mark D Powell wrote:
> I am guessing that addressuid is shared by all the patient addresses so
> unless there is a column in the address table that has the effect of
> ordering the data timewise as Michel suggested then a table change is
> required. I would expect that the address table has an entry date
> associated with each address. Selecting max(entry_date) from address
> where b.addressuid = a.addressuid would work in this case as would a
> sequence number value that might have been added to give the table a
> PK.
>
> -- Mark D Powell --
>
But, if the addressuid is always increasing (typical sequence) then you
could do the same thing by selecting max(addressuid).
Received on Wed Dec 22 2004 - 13:02:44 CST