Oracle SQL Query to get exact last 30/31/28 days from sysdate -
I want a simple SQL query to get dates of sysdate and exact 30 days.
Ex: Today is March 12, 2014, the date should be between 13 February 2014 and 12 March 2014.
I can not do just for 30 days because in this case I will be February 10, 2014. But I do not want this way please suggest me that you have any idea
I am using the Oracle 11G version.
Thank you.
You can use the ADD_MONTHS function and use 1 as the following for months In the form of:
select ADD_MONTHS (TRUNC (SYSDATE, -1) from Dual; Here are these.
Comments
Post a Comment