Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Re: Alternative to a correlated query?
I had a similiar problem before where in order to find someones last pay
point I had to preform 5 correlated queries. obviously performance was'nt
great. What i did was to write a function to return the rowid of the record
I wanted.
It the example you have outlined write a function that accepts the
partnerid as an input variable. Create a cursor that returns a rows for
that partner, sorted by date descending. Fetch the first row. you now have
the rowid of the record you need. to use the function in a query simply add
the line
APPROVAL_TABLE.rowid = function(partner_table.ID)
HTH
--
Conan Farrell
Oracle DBA
Received on Wed Oct 27 1999 - 03:52:59 CDT
![]() |
![]() |