Advertisement
Shirai

Kappa

Apr 4th, 2016
103
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
T-SQL 0.56 KB | None | 0 0
  1. -----------------------------------------
  2. select c.CompanyPlanceName
  3. from
  4. Flights a inner join Routes b
  5. on a.IDRoute = b.IDRoute
  6. inner join CompanyPlaneName c
  7. on c.CompanyPlaneID = b.CompanyplaneID
  8. where a.IDFlight = @param
  9. ---------------------------------------
  10. select c.CompanyPlaneName
  11. from CompanyPlanceName c
  12. where c.CompanyPlaneID in
  13. (select CompanyplaneID from
  14. (select b.IDRoute,b.CompanyplanetID
  15. from Routes b
  16. where b.IDRoute in
  17. (select IDRoute from
  18. (select a.IDFlight,a.IDRoute
  19. from Flights a
  20. where a.IDFlight = @param) as STEP1
  21. )
  22. ) as STEP2)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement