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 assign data of the deleted row to variables?

1115


What are the different types of record groups in oracle? Explain each of them

1069


How to create id with auto_increment on oracle?

1040


Explain what are synonyms used for?

1093


What is a user role in oracle?

1183


How to create a table index in oracle?

1183


What is the usage of analyze command in oracle?

1140


How do you find out from the RMAN catalog if a particular archive log has been backed-up?

2172


What is the difference between PFILE and SPFILE in Oracle?

1108


What is enter substitution variable in oracle?

1094


How to get the Installed Oracle Version Information ?

1188


What is the difference between Delete, Truncate and Drop in Oracle?

1184


Explain the importance of .pll extension in oracle?

1057


Difference between inner join vs where ?

1096


What is BBED in Oracle?

1196