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 use null as conditions in oracle?

1000


Is java required for oracle client?

922


What is null value in oracle?

1034


How to check the server version in oracle?

1031


How to define an oracle cursor variable?

972


what is partitioning? Types of partitioning. explain? what is the new kind of partitioning type introduced in 9i?

2218


Please explain compound trigger in oracle?

993


How to convert character types to numeric types?

1054


What are the different windows events activated at runtime ?

2832


Database crashes. Corruption is found scattered among the file system neither of your doing nor of Oracles. What database recovery options are available? Database is in archive log mode.

1943


What is tns service name?

1071


What are the limitations oracle database 10g xe?

975


How to get last row id?

938


Can we protect our pl/sql source code?

992


please explain.. DB architecture ...

1965