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
Are sql connections encrypted?
What are packages in pl sql and also explain its advantages?
What are three advantages to using sql?
Which one is better sql or oracle?
What are the parts of a sql statement?
How does cross join work in sql?
What is string join?
What is sql performance tuning?
what is clause? : Sql dba
how to use like conditions? : Sql dba
What is sharding in sql?
What are different functions in sql?
What is a table in a database?
Is left join same as inner join?
What is record in pl sql?