What will be the output of this Query?
select to_char(trunc(add_months(sysdate-3),mm),mm/dd/yyyy) from dual

Answer Posted / nitin

Let SYSDATE = '20-Sep-2012'

Use below query,

select to_char(trunc(add_months(sysdate,-
3),'mm'),'mm/dd/yyyy') from dual;

It will give you ...
o/p :

'06/01/2012'

Is This Answer Correct ?    15 Yes 9 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is the current version of sql?

539


How to combine two stored procedures in sql?

591


How many types of privileges are available in sql?

738


what is a constraint? : Sql dba

711


What is meant by temporal data?

544






how to dump a table to a file with 'mysqldump'? : Sql dba

553


how tsql statements can be written and submitted to the database engine? : Transact sql

533


Is join an inner join?

536


How do temporal tables work?

519


how to install mysql? : Sql dba

580


What is the most restrictive isolation level? : Transact sql

555


What is pragma in pl sql?

599


What does fetching a cursor do?

614


What is partition by in sql?

569


How do you modify a column in sql?

535