Author Topic: Top 5 Landing  (Read 1556 times)

RichardKarl

  • Newbie
  • *
  • Posts: 14
    • View Profile
    • My Logbook
Re: Top 5 Landing
« Reply #15 on: April 24, 2018, 07:55:05 AM »
el tema es modificar la vista v_top_vs

Code: [Select]
alter view v_top_vs as
select gvauser_id AS pilot, min(abs(LandingVS)) AS vs
from pirepfsfk where abs(LandingVS) > 0 and datediff(now(), CreatedOn) <= 7 group by pilot
union
select pilot_id AS pilot, min(abs(LandingVS)) AS vs
from reports where abs(LandingVS) > 0 and datediff(now(), registration) <= 7 group by pilot
union
select gvauser_id AS pilot, min(abs(landing_vs)) AS vs
from vampireps where abs(landing_vs) > 0 and datediff(now(), flight_date) <= 7 group by pilot
order by vs
limit 5
Richard Karl
Consultor en Servicios Web