Hi! Could we please enable some services and cookies to improve your experience and our website?

SQLize | PHPize | SQLtest

Online Sandbox for SQL and PHP: Write, Run, Test, and Share SQL Queries and PHP Code

A A A
Login    Share code      Blog   FAQ
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 boarding_passes p join tickets t on t.ticket_no = p.ticket_no where p.flight_id = ( select f.flight_id from flights f where f.flight_no = 'PG0510' and f.scheduled_departure >= '2017-07-16' and f.scheduled_departure < '2017-07-17' ) ) t where m = 1 and t.passenger_name <> 'MIKHAIL VOROBEV' order by seat_no ;

Stuck with a problem? Got Error? Ask AI support!

Copy Clear