SQLize Online / PHPize Online  /  SQLtest Online

A A A
Share      Blog   Popular
Copy Format Clear
WITH RECURSIVE Data AS ( SELECT '2005-07-01' AS date UNION ALL SELECT DATE_ADD(date, INTERVAL 1 DAY) FROM Data WHERE date < '2005-07-31' ) SELECT COUNT(*) AS weekend_days FROM Data WHERE DAYOFWEEK(date) IN (1, 7);

Stuck with a problem? Got Error? Ask ChatGPT!

Copy Clear