我只想在给定日期获得月份
实施例。我的实体中有一个日期列表
01/02/2012
01/03/2012
03/01/2012
答案 0 :(得分: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;
答案 1 :(得分: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
答案 2 :(得分:0)
To_Char():http://docs.oracle.com/cd/E11882_01/server.112/e26088/functions200.htm#SQLRF06129 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