SQLize Online / PHPize Online  /  SQLtest Online

A A A
Share      Blog   Popular
Copy Format Clear
explain analyze select seat_no , passenger_name , contact_data from ( select p.seat_no , t.passenger_name , t.contact_data , max(case when t.passenger_name = 'MIKHAIL VOROBEV' then 1 end ) over(partition by substring(p.seat_no,'\d+')) m from flights f join boarding_passes p on p.flight_id = f.flight_id join tickets t on t.ticket_no = p.ticket_no where f.flight_no = 'PG0510' and f.scheduled_departure >= '2017-07-16' and f.scheduled_departure < '2017-07-17' ----- faking cost -- and p.boarding_no < 54 -- and p.seat_no < '21' -- and p.ticket_no > '0005432900' ) t where m = 1 and t.passenger_name <> 'MIKHAIL VOROBEV' order by seat_no ;

Stuck with a problem? Got Error? Ask ChatGPT!

Copy Clear