What will be the output of this Query?
select to_char(trunc(add_months(sysdate-3),mm),mm/dd/yyyy) from dual
Answer Posted / sreeharibabu
select to_char(trunc(add_months(sysdate,-3),'mm'),'mm/dd/yyyy') from dual;--sysdate:22-APR-2016 output :01/01/2016
-- corrections in add_months , mm ,mm/dd/yyyy
--- flow--
select add_months(sysdate,-3) from dual;--sysdate:22-APR-2016 -- output : 1/22/2016 8:15:24 AM
select trunc(add_months(sysdate,-3),'mm') from dual;--sysdate:22-APR-2016 output : 01/01/2016
| Is This Answer Correct ? | 0 Yes | 0 No |
Post New Answer View All Answers
Is sql dba a good career? : SQL DBA
What is the use of nvl function?
What are tables in sql?
When a dml statement is executed, in which cursor attributes, the outcome of the statement is saved?
what is the difference between union and union all? : Sql dba
what is 'trigger' in sql? : Sql dba
define join and explain different type of joins? : Sql dba
what is an index? : Sql dba
Is sql a oracle?
what are the 'mysql' command line options? : Sql dba
What is schema in sql example?
how can we destroy the session, how can we unset the variable of a session? : Sql dba
How can a pl sql block be executed?
what is innodb? : Sql dba
How is sql used in oracle?