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
what is dynamic SGA and static SGA
How to connect to oracle using service name instead of sid?
How does Oracle guarantee data integrity of data changes?
1) Does oracle have any table which contain all the exceptions and it's code internally?
How do I spool to a csv formatted file using sqlplus?
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
Explain the use of compress option in exp command.
How to use in conditions in oracle?
What is an oracle database table?
How to pass parameters to procedures in oracle?
Can select statements be used on views in oracle?
How to define default values for formal parameters?
Is there an oracle sql query that aggregates multiple rows into one row?
How to return top 5 rows in oracle?
How to start your 10g xe server from command line?