SQLize Online / PHPize Online  /  SQLtest Online

A A A
Share      Blog   Popular
Copy Format Clear
SELECT dow, rentals_count FROM ( SELECT DAYOFWEEK(CAST(rental_date AS DATE)) AS dow, COUNT(*) AS rentals_count FROM rental GROUP BY DAYOFWEEK(CAST(rental_date AS DATE)) ) AS subquery ORDER BY CASE dow WHEN 1 THEN 1 WHEN 2 THEN 2 WHEN 3 THEN 3 WHEN 4 THEN 4 WHEN 5 THEN 5 WHEN 6 THEN 6 WHEN 7 THEN 7 END;

Stuck with a problem? Got Error? Ask ChatGPT!

Copy Clear