代码段
WITH P AS ( select m.Departure_Airport || '-' || m.Arrival_Airport line , a.Aircraft_Type, '2021-04' m,
Avg(NVL(t.Final_Takeoff_Fuel - t.Final_Landing_Fuel,0)) ff,
m.departure_airport ,m.arrival_airport, 1 x, 1 xx, '', 'admin' admin, 'admin' admin1,
sysdate cd, sysdate ed, a.company_code
from ta_fli_matchtable m
left join tm_omd_aircraft a on m.aircraft_code = a.aircraft_code
left join Ta_Tif_Fuelinfo t on m.Match_Code = t.Match_Code
where m.flight_date > to_date('2021-04-01', 'yyyy-MM-dd')
and m.flight_date < to_date('2021-04-30', 'yyyy-MM-dd')
and a.company_code = '8Y'
group by m.departure_airport, m.arrival_airport, a.aircraft_type, a.company_code
order by ff)
SELECT p.* FROM p where ROWNUM>(select round(count(*)*0.1) from p) and ROWNUM<(select round(count(*)*0.9) from p)
这个语句无法查出结果,如果没有where条件是能查到结果的,求解惑rownum的用法
select * from(select rownum no ,id,name from student) where no>2; rownum作为子集操作就可以了
你好,我是有问必答小助手,非常抱歉,本次您提出的有问必答问题,技术专家团超时未为您做出解答
本次提问扣除的有问必答次数,将会以问答VIP体验卡(1次有问必答机会、商城购买实体图书享受95折优惠)的形式为您补发到账户。
因为有问必答VIP体验卡有效期仅有1天,您在需要使用的时候【私信】联系我,我会为您补发。