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
Login    Share code      Blog   FAQ

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

Copy Format Clear
CREATE TABLE my_tbl (outset_date DATE, date_of_interest DATE); INSERT INTO my_tbl (outset_date, date_of_interest) VALUES ('2023-01-11', '2023-01-13'), ('2023-01-11', '2023-01-18'), ('2023-01-11', '2023-02-02'); SELECT outset_date, date_of_interest, CEIL(DATEDIFF(date_of_interest, outset_date) / 4) how_many_intervals_have_passed FROM my_tbl;

Stuck with a problem? Got Error? Ask AI support!

Copy Clear