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

What is character functions?

1016


what is a database? : Sql dba

1098


What is before and after trigger?

890


What is left join example?

889


what is myisam? : Sql dba

1000


who introduced sql?

948


What is record data type?

858


What is pl sql collection?

920


Can a foreign key be null?

1030


what are date and time functions in mysql? : Sql dba

925


How to avoid using cursors? What to use instead of cursor and in what cases to do so?

1124


Can two tables have same primary key?

916


What are data types in pl sql?

1076


explain the difference between delete , truncate and drop commands? : Sql dba

1015


What is difference between db2 and sql?

938