SQLize Online / PHPize Online  /  SQLtest Online

A A A
Share      Blog   Popular
Copy Format Clear
(select 1 as 'sortf', inventory.film_id, film.title, film.rating as rating, customer.first_name, customer.last_name from rental join customer on rental.customer_id = customer.customer_id join inventory on rental.inventory_id = inventory.inventory_id join film on film.film_id = inventory.film_id where customer.first_name='KATIE' and customer.last_name='ELLIOTT' and film.rating = 'R') union all (select 2 as 'sortf',inventory.film_id, film.title, film.rating as rating, customer.first_name, customer.last_name from rental join customer on rental.customer_id = customer.customer_id join inventory on rental.inventory_id = inventory.inventory_id join film on film.film_id = inventory.film_id where customer.first_name='KATIE' and customer.last_name='ELLIOTT' and NOT film.rating = 'R') order by 'sortf',rating

Stuck with a problem? Got Error? Ask ChatGPT!

Copy Clear