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
What are the differences between in and exists clause?
which operator is used in query for pattern matching? : Sql dba
How much ram can sql express use?
Suppose a student column has two columns, name and marks. How to get name and marks of the top three students.
Is a secondary key the same as a foreign key?
Which sql statement is used to delete data from a database?
Can you skip header records while loading? : aql loader
What are the advantages of normalization?
What schema means?
What is primary key in db?
Can ddl statements be used in pl/sql?
How many triggers can be applied to a table?
What is difference between procedure and trigger?
Explain table and field in sql?
How do I turn a list into a table?