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 advantages of sql?

1055


what is an execution plan? When would you use it? How would you view the execution plan? : Sql dba

978


Does db2 use sql?

946


What is the maximum number of triggers, you can apply on a single table?

998


Can we perform dml on view?

1044


What is record type in pl sql?

993


What are stored procedures in mysql?

1019


Why stored procedure is faster than query?

1062


Mention what does plv msg allows you to do?

1121


How can we connect an Android App to an Oracle database and use the PL/SQL procedural code?

1138


How do you declare a constant?

960


What is pl sql block structure?

1034


Does mysql_real_escape_string prevent sql injection?

946


What is a sql select statement?

1040


What type of database is cloud sql?

1101