select query to select all records that were inserted in 15 minutes.for ex if now time is 10:00 then it shoulld fetch all record inserted from 9:45 to 10:00
Assuming you have a DATETIME
column named created
in your table:
SELECT id FROM tablename
WHERE ((created > DATE_SUB(NOW(), INTERVAL 15 MINUTE))
AND (created < NOW()))
select * from table WHERE datetimeField BETWEEN date_add(NOW(),INTERVAL -15 MINUTE) AND NOW();
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