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 is the difference between partitioning and sharding?
What are different categories of sql commands?
How does a trigger work?
What is the unique index?
How to get help at the sql prompt?
Mention what are different methods to trace the pl/sql code?
What is #table in sql?
What is a dynamic query?
What is pivot table in sql?
How to assign sql query results to pl sql variables?
Write a sql query to convert all character to uppercase after hypen.
How to start oracle sql developer?
How to avoid using cursors? What to use instead of cursor and in what cases to do so?
Can you selectively load only those records that you need? : aql loader
Is trigger a stored procedure?