Hi,
I got a table named patient_treatment_history
Below is some of the records inside the table.

patient_id,treatment_date,charges
1014,2002-01-28,20
1001,2002-02-02,100
1026,2002-04-08,74
1001,2002-04-15,85
1014,2002-05-05,50
1030,2002-05-16,125
1030,2002-06-18,180
1001,2002-06-25,125


I try to retrieve the last visit date for each patient using this query:
select patient_id,treatment_date from patient_treatment_history group
by(patient_id) order by treatment_date desc.
But the result is not what i expected.
Can anybody assist me on this?

Thanks.

---------------------------------------------------------------------
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/           (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

Reply via email to