-- Drop the projections table
DROP TABLE PROJECTIONS;

--Code Fragment 9.16
CREATE VIEW PROJECTIONS
 ( PROJECTION_ID, PROJECTION_NAME, PROJECTION_TYPE, SPHEROID_CODE, 
   PROJECTION_UOM, ZONE_CODE )
AS (
 SELECT PROJECTION_ID, PROJECTION_NAME, PROJECTION_TYPE, SPHEROID_CODE, 
        PROJECTION_UOM, ZONE_CODE
 FROM P_Audit A 
 WHERE A.When_Changed = (SELECT MAX(A2.When_Changed) 
                         FROM P_Audit A2 WHERE A.PROJECTION_ID = A2.PROJECTION_ID) AND 
       A.Operation <> 'D'
);
/




