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 the sql query to display the current date?
Show the cursor attributes of pl/sql.
Can we rename a column in the output of sql query?
What do you understand by exception handling in pl/sql?
How do you write a subquery?
how to increment dates by 1 in mysql? : Sql dba
how to concatenate two character strings? : Sql dba
Can we rollback delete command?
What are sql objects?
Give the order of sql select?
What is the usage of when clause in trigger?
what are the advantages and disadvantages of cascading style sheets? : Sql dba
Enlist the data types that can be used in pl/sql?
What is db journal file?
Are subqueries better than joins?