Oracle timestamp: change time value
I have a timestamp field in Oracle db with some date and time. I need to set time to be 00:00. Like '2011-开发者_StackOverflow09-01 17:55:00' -> '2011-09-01 00:00:00' Can you please advise optimal ways to do it?
Thanks!
Use the TRUNC()
function, as in:
UPDATE table
SET timestamp_column = TRUNC(timestamp_column)
WHERE ...
精彩评论