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

Answer Posted / rajeev

select to_char(trunc(add_months(sysdate-3),mm),mm/dd/yyyy) from dual--This query will return error...
we can use below query..
select to_char(trunc(add_months(sysdate-1,3),'mm'),'mm/dd/yyyy') from dual;
output:05/01/2018

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is trigger in pl sql with examples?

522


What is a left inner join?

536


what is the maximum length of a table name, database name, and fieldname in mysql? : Sql dba

620


Does sql view stored data?

535


What is sql basics?

580






Why does sql need a server?

564


Which is faster truncate or drop?

559


What is a temporal table?

494


What is the difference between jpql and sql?

555


How to find 3rd highest salary of an employee from the employee table in sql?

566


what are the differences between public, private, protected, static, transient, final and volatile? : Sql dba

554


Does mysql support pl sql?

624


How to select 10 records from a table?

648


Does pl/sql support create command?

577


Do we need to rebuild index after truncate?

529