Oracle Timestamp: extract full hour
oracle, sql, timestamp
Solution
SELECT TRUNC(m.begin, 'HH24')
FROM mytable m
Problem
I need to extract the 'full' hour of a timestamp. Like for 2010.03.04 13:13 I want 2010.03.04 13:00 (as a timestamp again). My current approach is: ``` TO_TIMESTAMP(TO_CHAR(m.begin, 'yyyy.mm.dd hh24'), 'yyyy.mm.dd hh24') ``` Is this really the way to go? Who good/bad does it perform (I plan to do a GROUP BY on it). Thanks for your input! Cheers, Reto