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 are field types?
What do you mean by table in sql?
Why are aggregate functions called so?
What is sql basics?
How to install oracle sql developer?
What is output spooling in sql*plus?
What are some predefined exceptions in pl/sql?
What are the ddl commands?
What is a nested table in word?
Is merge a dml statement?
What is trigger with example?
What is column?
What does pragma mean?
How to get unique records from a table?
What is sql keyword?