Home » SQL & PL/SQL » SQL & PL/SQL » RETURN MONTH (ORACLE 10G)
RETURN MONTH [message #443758] Wed, 17 February 2010 04:26 Go to next message
mamalik
Messages: 266
Registered: November 2008
Location: Pakistan
Senior Member

DEAR ALL,

I need a query to whome i will pass month in number and that should return name of month. If i input 1 it should return Jan,2,Feb but don't use decode etc.

Is there any query with Julian format or any other date function?

I dont want to use ,Case and Decode ,level etc.

Regards.
Asif
Re: RETURN MONTH [message #443759 is a reply to message #443758] Wed, 17 February 2010 04:30 Go to previous messageGo to next message
ramoradba
Messages: 2454
Registered: January 2009
Location: AndhraPradesh,Hyderabad,I...
Senior Member
SQL> select to_char(to_date('&mm','MM'),'Mon') from dual;
Enter value for mm: 1
old   1: select to_char(to_date('&mm','MM'),'Mon') from dual
new   1: select to_char(to_date('1','MM'),'Mon') from dual

TO_
---
Jan

SQL> /
Enter value for mm: 2
old   1: select to_char(to_date('&mm','MM'),'Mon') from dual
new   1: select to_char(to_date('2','MM'),'Mon') from dual

TO_
---
Feb

SQL> /
Enter value for mm: 3
old   1: select to_char(to_date('&mm','MM'),'Mon') from dual
new   1: select to_char(to_date('3','MM'),'Mon') from dual

TO_
---
Mar

SQL>


You better read the documents first.

sriram Smile
Re: RETURN MONTH [message #443762 is a reply to message #443758] Wed, 17 February 2010 04:42 Go to previous message
Michel Cadot
Messages: 63808
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
And the documentation is there: Datetime Format Models

Regards
Michel
Previous Topic: DATA LEVEL SECURITY
Next Topic: how to increment count when GROUP by is used
Goto Forum:
  


Current Time: Wed Sep 28 15:59:30 CDT 2016

Total time taken to generate the page: 0.11628 seconds