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';
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With