V_REPORT_AOC_FUEL]

select * from DISPATCH order by FLTID desc
SELECT TOP 1000 [FLTID]
      ,[VIP_ID]
      ,[VIP_NAME]
      ,[GENDER]
      ,[VIP_POS]
      ,[VIP_AGE]
      ,[VIP_HOBBY]
      ,[VIP_REMARK]
      ,[PHOTO]
      ,[VIP_TYPE]
      ,[VIP_CONTACT]
  FROM [ISA].[dbo].[V_FLIGHTS_VIPS]

select top 1  * from AIRLINES_FLighttime
order by ACTYPE,SEASON
Select * from Dispatch

select * from v_REPORT_AOC

CREATE VIEW [dbo].[V_REPORT_AOC_FUEL]
/*-------------------------------------------------------------------------------
创建时间: 04/03/2015 17:00:48
用途: 统计
创建人 :
 ----------------------------------------------------------------------------------*/     

AS

SELECT
日期    =DBO.PEK_OPS_Date(A.STD),
航班号  =RIGHT(A.FLTNO,LEN(A.FLTNO) - 2) ,
飞机    =RIGHT(AC, 5),
机型    =LEFT(AC,4),
起飞机场=A.DEPSTN ,
目的机场=A.ORIARRSTN,
计划起飞=DBO.ShortTime(DBO.PEKTime(A.STD)),
实际起飞=DBO.ShortTime(DBO.PEKTime(A.ATD)),
计划落地=DBO.ShortTime(DBO.PEKTime(A.STA)),
实际落地=DBO.ShortTime(DBO.PEKTime(A.ATA)),
CFP耗油 = CASE WHEN c.CFP IS NULL then 0 else c.TRIP_FUEL   END,
航线耗油= CASE WHEN c.CFP IS NULL then
                    case when c.TRIP_FUEL IS NULL then
                              g.TRIP_FUEL else c.TRIP_FUEL
                    end
                 ELSE  0
               END
 from FLIGHTS a left join Dispatch c on c.FLTID=a.FLTID
 left join  (select D.SEASON,D.ACTYPE,D.TRIP_FUEL,E.DEPSTN,E.ARRSTN  from AIRLINES_Routes_Fuel D ,AIRLINES_ROUTES e
             WHERE E.ROUTE_ID=d.ROUTE_ID) AS G
             ON   A.DEPSTN=g.DEPSTN and a.ARRSTN=g.ARRSTN and
                 dbo.GetSeason(a.STD)=g.season AND LEFT(A.AC,4)=G.ACTYPE
 where a.status<>‘CNL‘and ETD > ‘2015-04-01 00:00:00‘
时间: 2024-10-27 08:18:35

V_REPORT_AOC_FUEL]的相关文章