Create a view using

 

  CREATE VIEW <viewname> (Patientdate, PatientID, Testcode ) +

  AS SELECT MAX(Patientdate), PatientID, Testcode  +

  FROM <tablename>  GROUP BY PatientID, Testcode

 

Tony

 

 

From: [email protected] [mailto:[email protected]] On Behalf Of Michael J. 
Sinclair
Sent: dinsdag 13 oktober 2015 2:23
To: [email protected]
Subject: [RBASE-L] - extracting the most recent data

 

Hi all

 

I have a very long skinny table, 3 columns. 
A date, a patient number and test code.

 

I want to extract the rows that are the most recent test code for each patient.

 

If patient #3000 has had testcode # 80015 10 times over the last year, then I 
only want the most recent row for that testcode/patient combination

 

Is there a single command that can do that?

 

Mike

Reply via email to