How can i get last there previous month names by useing system date
How can i get last there previous month names by useing system date
Select to_char(add_months(sysdate,-rownum),'month') prev_months from user_tables where rownum<=3;
I got the answer for question
select datename(month, dateadd("month",-1,getdate())), datename(month, dateadd("month",-2,getdate())),
datename(month, dateadd("month",-3,getdate()))
Sorry boreddy u cant use month is quotes.
Use
select datename(month, dateadd(month,-1,getdate())), datename(month,
dateadd(month,-2,getdate())),datename(month, dateadd(month,-3,getdate()))