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

Explain enable novalidate constraint.

1091


How do I recompile a procedure in oracle?

965


What is oracle instant client?

1028


What do you understand by a database object? Can you list a few of them?

1020


What are the differences between date and timestamp in oracle?

1051


Explain the truncate in oracle?

971


Can multiple columns be used in group by in oracle?

990


What is ceil and floor in oracle?

1073


How many types of synonyms in Oracle?

1127


How to pass a cursor variable to a procedure?

1113


How do I manually create a database in oracle?

1025


How to check database size in Oracle?

1196


What is format trigger?

2077


What is the difference between 10g OEM and 11g OEM?

969


What is a sub query? Describe its types?

1024