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 speed up webrick?
How to insert a new row into a table in oracle?
How to define an anonymous procedure with variables?
Explain the importance of .pll extension in oracle?
How to view the data files in the current database?
How to write a query with a right outer join in oracle?
What is the quickest way to export a table to a flat file?
Illustrate how to determine the amount of physical CPUs a Unix Box possesses (LINUX and/or Solaris).
How to pass parameters to procedures in oracle?
How to work with data objects interactively?
How do I know if oracle is installed on windows?
How to convert numbers to characters in oracle?
How to define a cusotmer as a supplier in ORACLE R12
what is partitioning? Types of partitioning. explain? what is the new kind of partitioning type introduced in 9i?
Differentiate between post-database commit and post-form commit?