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...

How to find no of saturdays in a month using single sql ?

Answer Posted / anuradha

Select Count(*)
From (Select Trunc(To_Date('20120305', 'yyyymmdd'), 'MM')
+ Rownum - 1 Dates
From (Select 1 From Dual Group By Cube(2, 2, 2,
2, 2))
Where Rownum <=
Add_Months(Trunc(To_Date
('20120305', 'YYYYMMDD'), 'MM'), 1) -
Trunc(To_Date('20120305', 'YYYYMMDD'), 'MM'))
Where To_Char(Dates, 'DY') In ('SAT');

Is This Answer Correct ?    1 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How to manage transaction isolation level?

962


Select all the employees who were hired in last 2 years and who works in dept where max managers are working.

2913


How to store only time; not date and time?

978


what is the use of triggers in Java program? I mean where do we use triggers in Java programming?

2143


What is define in oracle?

1025


What happens internally when the user types userID/password@string in SQL PLUS Thanks-Bhaskar

4514


Typically, where is the conventional directory structure chosen for Oracle binaries to reside?

2089


Which is faster join or subquery in oracle?

947


How to drop an index in oracle?

1033


How to omit columns with default values in insert statement in oracle?

1016


How do I know if oracle client is installed on windows?

975


How data locks are respected in oracle?

1025


Is truncate autocommit in oracle?

1045


What is an external table?

971


How can I convert single byte kana characters into multi byte kana characters and vice-versa.

2345