From the events
table below, how do I select events
created less than 15 minutes ago?
CREATE TABLE events (
created_at timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP
);
SELECT created_at FROM events WHERE created_at > NOW() - INTERVAL '15 minutes';
SELECT * FROM events WHERE age(now(), created_at) < '15 minutes';
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.