Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.misc -> Re: "GROUP BY" - FAQ I've no doubt but I can't find the answer
Well I have already (approx 2001-10-10 01.00 UTC) posted a follow up
to this thread which doesn't seem to have appeared yet in the NG. I'll
assume it will appear and go on from there.
Basically I had some difficultities with the approaches suggested and I started looking for alternate methods. I seem to have found one by writing a function like this ...
CREATE FUNCTION (PAR_ID_IN IN TAS_PARTICIPANT.PAR_AUTOID%TYPE)
RETURN NUMBER
IS
CURSOR PEV_CUR
IS
SELECT PEV_PET_EVENT_TYPE,PEV_EVENT_DATETIME
FROM TAS_PARTICIPANT_EVENT
WHERE PEV_PAR_ID = PAR_ID_IN
ORDER BY PEV_EVENT_DATETIME DESC;
latest_Event_Type TAS_PARTICIPANT_EVENT.PEV_PET_EVENT_TYPE%TYPE;
latest_Event_DateTime TAS_PARTICIPANT_EVENT.PEV_EVENT_DATETIME%TYPE;
BEGIN
OPEN PEV_CUR;
FETCH PEV_CUR INTO latest_Event_Type,latest_Event_DateTime;
CLOSE PEV_CUR;
RETURN latest_Event_Type;
END;
... I'd still be interested in finding a less clunky way of doing it
but this at least seems to provide me what I need in the short term.
Thanks for all help and I'd still be interested to hear suggestions to the original post.
regards
richard shea.
rshea_at_my-deja.com
Received on Wed Oct 10 2001 - 00:34:23 CDT