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:
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user