/*****************************************************************************
*
* Filename         - $Workfile:   ltr_month_v1.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:   ltr_month_v1.sql  $  $Revision:   1.0  $
*
* 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/ltr_month_v1.svl  $
* 
*    Rev 1.0   06 Jun 2000 10:05:52   tagtrak
* Initial revision
*

*****************************************************************************/
PROMPT Creating view ltr_month_v1

CREATE OR REPLACE FORCE VIEW ltr_month_v1 AS
SELECT
TRUNC(ltr.month_end(flight_date)) END_DATE
,carrier
,alpha_code
,flight_no
,SUM(loaded) - SUM(deleted)				LOADED
,SUM(transfer)						TRANSFER
,SUM(local)								LOCAL
,SUM(rush)								RUSH
,SUM(other)								OTHER
,SUM(short)								SHORT
FROM loading_totals
WHERE TRUNC(ltr.month_end(flight_date)) < TRUNC(SYSDATE)
GROUP BY 
TRUNC(ltr.month_end(flight_date)) 
,carrier
,alpha_code
,flight_no
/
