Path: news.easynews.com!easynews!sjcppf01.usenetserver.com!usenetserver.com!cyclone.bc.net!newsfeed.stanford.edu!postnews1.google.com!not-for-mail
From: rshea@my-deja.com (Richard Shea)
Newsgroups: comp.databases.oracle.misc
Subject: Re: "GROUP BY"  - FAQ I've no doubt but I can't find the answer
Date: 9 Oct 2001 22:34:23 -0700
Organization: http://groups.google.com/
Lines: 38
Message-ID: <43160f6f.0110092134.9df6ad3@posting.google.com>
References: <43160f6f.0110082246.63e4d0e4@posting.google.com> <a20d28ee.0110090402.5cb52372@posting.google.com>
NNTP-Posting-Host: 203.96.152.181
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 8bit
X-Trace: posting.google.com 1002692063 31038 127.0.0.1 (10 Oct 2001 05:34:23 GMT)
X-Complaints-To: groups-abuse@google.com
NNTP-Posting-Date: 10 Oct 2001 05:34:23 GMT
Xref: easynews comp.databases.oracle.misc:70101
X-Received-Date: Wed, 10 Oct 2001 02:37:33 MST (news.easynews.com)

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@my-deja.com
