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 / praveen

Let sysdate=30/07/2012;

let see dis query
select add_months(sysdate,-3) from dual;
//ans=07/30/2012-mm/dd/yyyy
select trunc(add_months(sysdate,-3),'mm') from dual;
//ans=07/01/2012-mm/dd/yyyy
select to_char(trunc(add_months(sysdate,-3),'mm'),'mm/dd/yyyy from dual;
//ans=07/01/2012-mm/dd/yyyy

Is This Answer Correct ?    4 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is the difference between partitioning and sharding?

1051


What are different categories of sql commands?

1195


How does a trigger work?

1145


What is the unique index?

1110


How to get help at the sql prompt?

1164


Mention what are different methods to trace the pl/sql code?

1296


What is #table in sql?

1182


What is a dynamic query?

1073


What is pivot table in sql?

1171


How to assign sql query results to pl sql variables?

1146


Write a sql query to convert all character to uppercase after hypen.

1484


How to start oracle sql developer?

1075


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

1248


Can you selectively load only those records that you need? : aql loader

1093


Is trigger a stored procedure?

984