I am working on writing a SQL query to categorize one of my timestamp column to 15 minutes bucket. I did some research and tried multiple methods but I am not getting the desired result.
SELECT
dd,
trunc(dd) + ROUND(TO_CHAR(dd,'SS')/900)/96 as round_1,
trunc(dd, 'hh24') + ROUND(to_char(dd, 'MI')/15)*15/1440 as round_2,
trunc(dd, 'mi') - mod(EXTRACT(minute FROM cast(dd as timestamp)), 15) / (24 * 60) as round_3,
to_char(trunc(dd,'hh') + (15*round(to_char(trunc(dd,'MI'),'MI')/15))/1440,'YYYY-MM-DD hh24:mi:ss') as round_4
FROM
Table
When I execute the above queries, I see the following results.
***Edits, Updated the Question based on Gordon reply

