Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

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


Please Help Members By Posting Answers For Below Questions

Is sql dba a good career? : SQL DBA

1049


What is the use of nvl function?

1243


What are tables in sql?

1116


When a dml statement is executed, in which cursor attributes, the outcome of the statement is saved?

1173


what is the difference between union and union all? : Sql dba

1069


what is 'trigger' in sql? : Sql dba

1146


define join and explain different type of joins? : Sql dba

1002


what is an index? : Sql dba

1040


Is sql a oracle?

1022


what are the 'mysql' command line options? : Sql dba

1134


What is schema in sql example?

1278


how can we destroy the session, how can we unset the variable of a session? : Sql dba

1051


How can a pl sql block be executed?

1004


what is innodb? : Sql dba

1172


How is sql used in oracle?

1037