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 sap sql anywhere?
Is sql a dbms?
What is difference between sql and mysql?
What is error ora-12154: tns:could not resolve the connect identifier specified?
What is faster join or subquery?
Can pl sql procedure have a return statement?
how to return query output in html format? : Sql dba
What is rank dense_rank and partition in sql?
Which kind of parameters cannot have a default value in pl sql?
What is nvarchar in sql?
The in operator may be used if you know the exact value you want to return for at least one of the columns.
What is the difference between inner join and natural join?
List out the acid properties and explain?
What is mdf ldf and ndf?
Explain what is a database?