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

what is dynamic SGA and static SGA

4407


How to connect to oracle using service name instead of sid?

1012


How does Oracle guarantee data integrity of data changes?

2380


1) Does oracle have any table which contain all the exceptions and it's code internally?

1747


How do I spool to a csv formatted file using sqlplus?

1022


22. Display the order number, number of lines in the order, total number of items and total value for all orders that have a total value greater than $100

2012


Explain the use of compress option in exp command.

1015


How to use in conditions in oracle?

1045


What is an oracle database table?

1004


How to pass parameters to procedures in oracle?

1037


Can select statements be used on views in oracle?

1022


How to define default values for formal parameters?

1033


Is there an oracle sql query that aggregates multiple rows into one row?

968


How to return top 5 rows in oracle?

1052


How to start your 10g xe server from command line?

1067