/*****************************************************************************
*
* Filename         - $Workfile:   stats_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 stats_v1
*
* Language         - Oracle SQL*Plus script
*
* Classification   - Commercial In Confidence
*
*          (c) Ultra Electronics Limited, 1998
*
*****************************************************************************/
/****************************************************************************
* @(#)$Workfile:   stats_v1.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/stats_v1.svl  $
* 
*    Rev 1.1   21 Jun 2001 15:38:00   tagtrak
* OR:
* CR:
* Re-baseline version 4.0.0 to include patches.
* 
*    Rev 1.0   19 Nov 1998 16:46:30   tagtrak
* OR: 12712 12689
* CR: 12712
* REV:
* Initial Check-in to PVCS
* Modifications to support bag source (local or transfer etc)
* in loading statistics.
* 
*
****************************************************************************/

/*
 * View stats_v1 represents the stats in the way that the stats
 * table would have held them prior to the stats table changing
 * to split the stats by bag-source.
 */
PROMPT Creating view stats_v1

CREATE OR REPLACE FORCE VIEW stats_v1 (
	date_time,
	hour,
	login_name,
	flight_no,
	flight_date,
	normal,
	gate ,
	crew,
	rush,
	misc
)
as
	select
		date_time,
		hour,
		login_name,
		flight_no,
		flight_date,
		sum(normal),
		sum(gate),
		sum(crew),
		sum(rush),
		sum(misc)
	from
		stats
	group by
		date_time,
		hour,
		login_name,
		flight_no,
		flight_date;

