CREATE OR REPLACE FORCE VIEW v_current_quote_status AS SELECT qute_id ,event_date ,qust_code FROM (SELECT qute_id ,event_date ,qust_code ,id ,MAX(id) over(PARTITION BY qute_id) AS max_event FROM quote_events) WHERE id = max_event /