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 are the differences between in and exists clause?

1050


which operator is used in query for pattern matching? : Sql dba

950


How much ram can sql express use?

934


Suppose a student column has two columns, name and marks. How to get name and marks of the top three students.

956


Is a secondary key the same as a foreign key?

955


Which sql statement is used to delete data from a database?

898


Can you skip header records while loading? : aql loader

976


What are the advantages of normalization?

1040


What schema means?

847


What is primary key in db?

936


Can ddl statements be used in pl/sql?

1070


How many triggers can be applied to a table?

995


What is difference between procedure and trigger?

919


Explain table and field in sql?

1016


How do I turn a list into a table?

909