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

SQLize Online / PHPize Online  /  SQLtest Online

A A A
Share code      Blog   Popular   FAQ

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

Copy Format Clear
select f.title, release_year, b.length, b.replacement_cost from film f left join ( select max(length) as length, min(replacement_cost) as replacement_cost from film group by length having count(length) > 1 order by max(length) desc ) as b on f.length = b.length and f.replacement_cost = b.replacement_cost order by b.length desc

Stuck with a problem? Got Error? Ask ChatGPT!