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 nosql db?

960


Explain what is sql?

1109


How do you delete a table?

1065


What is an index in sql with example?

965


How consistent is the view of the data between and within multiple sessions, transactions or statements ?

2216


What is the difference between cluster and non-cluster index?

1104


What is difference between inner join and self join?

1079


how to calculate expressions with sql statements? : Sql dba

1032


Which is better cte or subquery?

1026


how can we encrypt and decrypt a data present in a mysql table using mysql? : Sql dba

1182


What is rownum?

972


what are string data types? : Sql dba

1039


What is sql data?

984


What is the syntax and use of the coalesce function?

1160


How does sql profiler work?

1011