Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: How To Extract Hour From A Date Column In A Table?
cdavis10717_at_comcast.net wrote:
> All,
>
> I can not work out the proper syntax to extract the hour from a date
> column in my table.
>
> Examples I have found select from DUAL, but I want it from a user table
> instead.
>
> An example like:
>
> SELECT extract(hour from my_date_column 'HH24') as TheHour from
> my_table;
>
> doesn't work at all, I get syntax error.
>
> Has anyone done this and can provide working syntax?
> Thanks in advance.
>
> CD
select to_char(your_date_column, 'HH24') from your_table; This is ofcourse all in the docs.
Regards
/Rauf
Received on Wed Apr 05 2006 - 16:52:09 CDT