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 use null as conditions in oracle?
Is java required for oracle client?
What is null value in oracle?
How to check the server version in oracle?
How to define an oracle cursor variable?
what is partitioning? Types of partitioning. explain? what is the new kind of partitioning type introduced in 9i?
Please explain compound trigger in oracle?
How to convert character types to numeric types?
What are the different windows events activated at runtime ?
Database crashes. Corruption is found scattered among the file system neither of your doing nor of Oracles. What database recovery options are available? Database is in archive log mode.
What is tns service name?
What are the limitations oracle database 10g xe?
How to get last row id?
Can we protect our pl/sql source code?
please explain.. DB architecture ...