How to find no of saturdays in a month using single sql ?
Answers were Sorted based on User's Feedback
Answer / 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 |
Answer / nagaraju
select count(*) from (
select trunc(to_date(sysdate,'DD/MM/rrrr'),'mm') +rownum -1 dates
from dual connect by level <=Add_Months(trunc(to_date(sysdate,'DD/MM/rrrr'),'mm'),1) - trunc(to_date(sysdate,'DD/MM/rrrr'),'mm')
)
where
to_char(dates,'DY')='SAT'
Is This Answer Correct ? | 0 Yes | 0 No |
What does a Control file Contain ?
What are the various constraints used in oracle?
Can we write dml statement in function in oracle?
what are archived logs?
How to put more than 1000 values into an oracle in clause?
State and explain the different types of data models?
Which Department has MOST NUMBER of employees?
8 Answers IBM, LeadSquared, Mastek,
What are triggers in oracle?
various types of joins
How to recover a dropped index?
How to list all user accounts in oracle?
Anyone have the Latest Oracle Dumbs?While u have please forard to narain1411@gmail.com