Hi! Could we please enable some services and cookies to improve your experience and our website?

SQLize | PHPize | SQLtest

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

A A A
Login    Share code      Blog   FAQ
Copy Format Clear
CREATE TABLE test( started_at TIMESTAMPTZ NOT NULL, finished_at TIMESTAMPTZ NOT NULL ); INSERT INTO test VALUES('2022-01-01 12:00:00', NOW()), ('2022-04-29 13:55:33', NOW()); SELECT t.*, EXTRACT(EPOCH FROM finished_at - started_at) / 60 as duration FROM test t

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

Copy Clear