Updated view to pick current status based on event_date rather than ID. This fixes an issue with me picking the wrong sequence. I've also corrected that.

git-svn-id: http://locode01.ad.dom/svn/WEBMIP/trunk@3705 248e525c-4dfb-0310-94bc-949c084e9493
This commit is contained in:
mullenm
2008-02-26 11:07:26 +00:00
parent 12d9108f38
commit 209d393ac5

View File

@@ -6,6 +6,7 @@ SELECT docu_id
,event_date
,dost_code
,id
,MAX(id) over(PARTITION BY docu_id) AS max_id
,MAX(event_date) over(PARTITION BY docu_id) AS max_date
FROM document_events)
WHERE id = max_id;
WHERE event_date = max_date