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
Explain enable novalidate constraint.
How do I recompile a procedure in oracle?
What is oracle instant client?
What do you understand by a database object? Can you list a few of them?
What are the differences between date and timestamp in oracle?
Explain the truncate in oracle?
Can multiple columns be used in group by in oracle?
What is ceil and floor in oracle?
How many types of synonyms in Oracle?
How to pass a cursor variable to a procedure?
How do I manually create a database in oracle?
How to check database size in Oracle?
What is format trigger?
What is the difference between 10g OEM and 11g OEM?
What is a sub query? Describe its types?