An Someone Please Check My Sql Query It Is Nearly Finished But I Can T Find The

an someone please check my SQL query? It is nearly finished but i can’t find the small errors.. i know i have an error by the GROUP BY clause and maybe FROM, but nothing i change works. Help..?

/* Used with a movie rental database: 

WITH t2 AS

(SELECT category, rental_duration,

NTILE(4) OVER (ORDER BY rental_duration) standard_quartile

FROM

(SELECT c.name category, f.rental_duration

FROM film f

JOIN film_category fc

ON f.film_id = fc.film_id

JOIN category c

ON fc.category_id =c.category_id)t1

WHERE category IN (‘Animation’, ‘Children’, ‘Classics’, ‘Comedy’, ‘Family’, ‘Music’))

group by 1,2

ORDER BY 1,2;

0 replies

Leave a Reply

Want to join the discussion?
Feel free to contribute!

Leave a Reply