/*****************************************************************************
*
* Filename         - $Workfile:   security_bag_month_v3.sql  $
*
*                     Name              Date      Version     CR Number
* Author           - See revision history below.
* Last Update      - See revision history below.
*
* Project Name     - TAGTRAK(Oracle Database)
*
* Source Code
* Identifier       - 0/3/300/8010/112
*
* Design Spec
* Section          - 
*
* Contents         - Live Schema View
*
* Language         - Oracle SQL*Plus script
*
* Classification   - Commercial In Confidence
*
*          (c) Ultra Electronics Limited, 2000
*
*****************************************************************************/
/****************************************************************************
* @(#)$Workfile:   security_bag_month_v3.sql  $  $Revision:   1.1  $
*
* Revision History
*
* Note that user tagtrak is many users. For these users the user
* name is entered as the last line in the change description.
*
* $Log:   /pvcsarch/db_ora/db/source/live/views/security_bag_month_v3.svl  $
* 
*    Rev 1.1   21 Jun 2001 15:37:54   tagtrak
* OR:
* CR:
* Re-baseline version 4.0.0 to include patches.
* 
*    Rev 1.0   25 Sep 2000 11:46:14   tagtrak
* OR:
* CR: 15247
* REV:
*
*****************************************************************************/
PROMPT Creating view security_bag_month_v3

CREATE OR REPLACE FORCE VIEW security_bag_month_v3 AS
SELECT
end_date
,flight_date
,carrier_desc
,SUM(check_in) CHECK_IN
,SUM(level_one) LEVEL_ONE
,ROUND((NVL(SUM(level_one),0) / DECODE(SUM(check_in),NULL,1,0,1,SUM(check_in))) * 100) READ_RATE
,SUM(level_three) LEVEL_THREE
,SUM(level_four) LEVEL_FOUR
,agent_code
FROM
security_bag_month_v1
GROUP BY
end_date
,flight_date
,carrier_desc
,agent_code
/
