What will be the output of this Query?
select to_char(trunc(add_months(sysdate-3),mm),mm/dd/yyyy) from dual
Answer Posted / sreeharibabu
select to_char(trunc(add_months(sysdate,-3),'mm'),'mm/dd/yyyy') from dual;--sysdate:22-APR-2016 output :01/01/2016
-- corrections in add_months , mm ,mm/dd/yyyy
--- flow--
select add_months(sysdate,-3) from dual;--sysdate:22-APR-2016 -- output : 1/22/2016 8:15:24 AM
select trunc(add_months(sysdate,-3),'mm') from dual;--sysdate:22-APR-2016 output : 01/01/2016
Is This Answer Correct ? | 0 Yes | 0 No |
Post New Answer View All Answers
What is insert command in sql?
How do I run sql?
What is nvarchar in sql?
What are hotfixes and patches?
What is pl sql record in oracle?
What is posting?
How do I copy a table in sql?
How to sort the rows in sql.
What is the difference between inner join and left join?
What is secondary key?
What is full form of rtm?
How does sql*loader handles newline characters in a record? : aql loader
Is sql free?
what is user defined functions? : Sql dba
What is a pdo connection?