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
select clase, count (clase) from (select flight_no , sum(amount), case when sum(amount) < 50000000 then 'low' when sum(amount) between 50000000 and 150000000 then 'middle' when sum(amount) > 150000000 then 'high' end clase from ticket_flights tf join flights f on tf.flight_id =f.flight_id group by flight_no) ggg group by clase

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

Copy Clear