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
What is character functions?
what is a database? : Sql dba
What is before and after trigger?
What is left join example?
what is myisam? : Sql dba
who introduced sql?
What is record data type?
What is pl sql collection?
Can a foreign key be null?
what are date and time functions in mysql? : Sql dba
How to avoid using cursors? What to use instead of cursor and in what cases to do so?
Can two tables have same primary key?
What are data types in pl sql?
explain the difference between delete , truncate and drop commands? : Sql dba
What is difference between db2 and sql?