Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- select flight_number as 'номер рейса', plane_type as 'тип самолета', time_of_departure as 'время вылета',
- arrival_time as 'время прибытия', a.name as 'название компании-перевозчика',
- (select name from towns where id = z.arrival_town_id) as 'город вылета',
- (select name from towns where id = z.departure_town_id) as 'город прибытия'
- from flight_info as z join airlines as a on z.company_id = a.id
- where (
- (select count(family_name) from one_flight_info as x join passengers_info as y on x.id=y.one_flight_id
- where z.flight_number=x.flight_id) =
- (select max(u.c) from (select count(family_name) as c from one_flight_info as xx join passengers_info as yy on xx.id=yy.one_flight_id
- group by xx.flight_id) as u))
Advertisement
Add Comment
Please, Sign In to add comment