2

我只想得到给定日期的月份

前任。我的实体中有一个日期列表

01/02/2012
01/03/2012
03/01/2012
4

3 回答 3

1

如果你想得到月份数,01那么试试这个

select to_char(date_val,'MM') from dual

试试Mon这个

select to_char(date_val,'Mon') from dual

试试Month这个

select to_char(date_val,'Month') from dual
于 2013-01-22T07:58:13.940 回答
1
select to_char(date_value,'MM') from dual;
select to_char(date_value,'Mon') from dual;
select to_char(date_value,'Month') from dual;

?

于 2013-01-21T07:16:53.497 回答
0

To_Char(): http://docs.oracle.com/cd/E11882_01/server.112/e26088/functions200.htm#SQLRF06129 Date Formats for To_Char(): docs.oracle.com/cd/E11882_01/server.112/e26088/sql_elements004.htm#i34510 Extract(): http://docs.oracle.com/cd/E11882_01/server.112/e26088/functions059.htm#SQLRF00639

于 2013-01-21T08:09:56.120 回答