What will be the output of this Query?
select to_char(trunc(add_months(sysdate-3),mm),mm/dd/yyyy) from dual
Answer Posted / praveen
Let sysdate=30/07/2012;
let see dis query
select add_months(sysdate,-3) from dual;
//ans=07/30/2012-mm/dd/yyyy
select trunc(add_months(sysdate,-3),'mm') from dual;
//ans=07/01/2012-mm/dd/yyyy
select to_char(trunc(add_months(sysdate,-3),'mm'),'mm/dd/yyyy from dual;
//ans=07/01/2012-mm/dd/yyyy
| Is This Answer Correct ? | 4 Yes | 0 No |
Post New Answer View All Answers
Does pdo prevent sql injection?
What are tables and fields?
how can we know the number of days between two given dates using mysql? : Sql dba
How can check sql version from command line?
What is the use of sqlerrd 3?
Where is all the data on the internet stored?
What is nested table in pl sql?
State some properties of relational databases?
What are the different types of joins in sql?
When is a declare statement required?
how can you see all indexes defined for a table? : Sql dba
What are different functions in sql?
What are all the common sql functions?
what is online transaction processing (oltp)? : Sql dba
What is a join?