Changes to schema and code to place 'id' as PK field in quote_events and enquiry_events as part of ticket #78.
Changed BULK_LOAD.xls to have two tabs to represent costs. Also includes QMAX against module - none of these changes are represented in the current code. git-svn-id: http://locode01.ad.dom/svn/WEBMIP/trunk@3480 248e525c-4dfb-0310-94bc-949c084e9493
This commit is contained in:
@@ -6,36 +6,7 @@ SELECT qute_id
|
||||
FROM (SELECT qute_id
|
||||
,event_date
|
||||
,qust_code
|
||||
,decode(qust_code
|
||||
,'INP'
|
||||
,1
|
||||
,'AV'
|
||||
,2
|
||||
,'SELREJ'
|
||||
,3
|
||||
,'SELECTED'
|
||||
,5
|
||||
,'REJECTED'
|
||||
,6
|
||||
,'ACCEPTED'
|
||||
,7
|
||||
,'LAPSED'
|
||||
,8) AS this_event
|
||||
,MAX(decode(qust_code
|
||||
,'INP'
|
||||
,1
|
||||
,'AV'
|
||||
,2
|
||||
,'SELREJ'
|
||||
,3
|
||||
,'SELECTED'
|
||||
,5
|
||||
,'REJECTED'
|
||||
,6
|
||||
,'ACCEPTED'
|
||||
,7
|
||||
,'LAPSED'
|
||||
,8)) over(PARTITION BY qute_id) AS max_event
|
||||
,id
|
||||
,MAX(id) over(PARTITION BY qute_id) AS max_event
|
||||
FROM quote_events)
|
||||
WHERE this_event = max_event
|
||||
/
|
||||
WHERE id = max_event
|
||||
|
||||
Reference in New Issue
Block a user