以下为SQLSELECT *FROM (SELECT F_YUE as 月份,F_NIAN as 年度,SUM(F_FYJE30) AS 航油消耗,SUM(F_FYJE5) AS 起降服务费,SUM(F_FYJE18) AS 头等舱服务费,SUM(F_FYJE26) AS 餐食机供品,SUM(F_FYJE20) AS 民航发展基金,SUM(F_FYJE21) AS 不正常航班费用,SUM(F_FYJE9) AS 客货邮行赔偿费,SUM(F_FYJE24) AS 机组食宿费用,SUM(F_FYJE17) AS 系统使用费,SUM(F_FYJE25) AS 飞行小时费,SUM(F_FYJE10) AS 代理手续费,SUM(F_FYJE105) AS 机务维修成本,SUM(F_FYJE62) AS 客舱服务费,SUM(F_FYJE296) AS BSP处理费,SUM(F_FYJE382) AS 其他变动成本,F_JXID as 机型代码,0,(SELECT F_JXDM FROM GG_FJJX WHERE F_JXID=A.F_JXID) AS 机型, case when length(F_YUE)=1 then to_char(F_NIAN)||'-'||'0'||to_char(F_YUE) else to_char(F_NIAN)||'-'||to_char(F_YUE) end as 月份2 FROM (SELECT /*+INDEX(A)*/F_YUE,F_NIAN,F_FYJE30,F_FYJE5,F_FYJE18,F_FYJE26,F_FYJE20,F_FYJE21,F_FYJE9,F_FYJE24,F_FYJE17,F_FYJE25,F_FYJE10,F_FYJE105,F_FYJE62,F_FYJE296,F_FYJE382,F_JXID,F_LJHD FROM FX_ZHFXB A WHERE F_CYGS IN (1,2)) A WHERE 1=1 GROUP BY F_YUE,F_NIAN,F_JXID ORDER BY F_YUE NULLS FIRST,F_NIAN NULLS FIRST,F_JXID NULLS FIRST)UNPIVOT ( 金额 FOR 成本项目 IN ("航油消耗","起降服务费","头等舱服务费","餐食机供品","民航发展基金","不正常航班费用","客货邮行赔偿费","机组食宿费用","系统使用费","飞行小时费","代理手续费","机务维修成本","客舱服务费","BSP处理费","其他变动成本")) WHERE 年度='2022' and 月份='09' AND 金额<>0