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 advantages of sql?
what is an execution plan? When would you use it? How would you view the execution plan? : Sql dba
Does db2 use sql?
What is the maximum number of triggers, you can apply on a single table?
Can we perform dml on view?
What is record type in pl sql?
What are stored procedures in mysql?
Why stored procedure is faster than query?
Mention what does plv msg allows you to do?
How can we connect an Android App to an Oracle database and use the PL/SQL procedural code?
How do you declare a constant?
What is pl sql block structure?
Does mysql_real_escape_string prevent sql injection?
What is a sql select statement?
What type of database is cloud sql?