
December 5th, 2012, 08:56 AM
|
|
Registered User
|
|
Join Date: Dec 2012
Posts: 2
Time spent in forums: 36 m 2 sec
Reputation Power: 0
|
|
|
Newbie needing help. Capture most current unique records
Here is my issue:
urn visit_no last_name first_name admit_date dis_date
3105 05424 MOUSE MICKEY 2012-11-15 2012-11-16
3105 06261 MOUSE MICKEY 2012-11-26 2012-11-28
3105 00469 MOUSE MICKEY 2011-11-01 2012-11-03
4204 00047 DUCK DAFFY 2010-12-01 2010-12-05
4204 00090 DUCK DAFFY 2010-07-01 2010-07-06
4204 06300 DUCK DAFFY 2012-12-01 2012-12-03
select P.URN, V.VISIT_NO, P.LAST_NAME, P.FIRST_NAME, V.ADMIT_DATE, V.DISCH_DATE
from PATIENT P
inner join VISIT V on P.URN = V.URN
What I want to end up with is the record with the last admit_date for the unique urn
3105 06261 MOUSE MICKEY 2012-11-26 2012-11-28
4204 06300 DUCK DAFFY 2012-12-01 2012-12-03
Thanks for any help/sugguestions
|