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 manage transaction isolation level?
Select all the employees who were hired in last 2 years and who works in dept where max managers are working.
How to store only time; not date and time?
what is the use of triggers in Java program? I mean where do we use triggers in Java programming?
What is define in oracle?
What happens internally when the user types userID/password@string in SQL PLUS Thanks-Bhaskar
Typically, where is the conventional directory structure chosen for Oracle binaries to reside?
Which is faster join or subquery in oracle?
How to drop an index in oracle?
How to omit columns with default values in insert statement in oracle?
How do I know if oracle client is installed on windows?
How data locks are respected in oracle?
Is truncate autocommit in oracle?
What is an external table?
How can I convert single byte kana characters into multi byte kana characters and vice-versa.