SELECT substring('w3resource' from 4 for 5);
select id, ten_minute_interval
from (
select to_timestamp(floor((extract('epoch' from CREATED_AT) / 600 )) * 600) as ten_minute_interval
, id
from TABLE_NAME
) as nested
where ten_minute_interval >= 'TIMESTAMP'