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
How to assign data of the deleted row to variables?
What are the different types of record groups in oracle? Explain each of them
How to create id with auto_increment on oracle?
Explain what are synonyms used for?
What is a user role in oracle?
How to create a table index in oracle?
What is the usage of analyze command in oracle?
How do you find out from the RMAN catalog if a particular archive log has been backed-up?
What is the difference between PFILE and SPFILE in Oracle?
What is enter substitution variable in oracle?
How to get the Installed Oracle Version Information ?
What is the difference between Delete, Truncate and Drop in Oracle?
Explain the importance of .pll extension in oracle?
Difference between inner join vs where ?
What is BBED in Oracle?