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 r tyhe major differences between oracle 9i & 10g?
How to Select second Maximum salary in a Table ?
What is a static data dictionary in oracle?
Why do you create or replace procedures rather that drop and recreate.
What is use of oracle?
What is where clause in oracle?
What are data pump export and import modes?
What are the major difference between truncate and delete?
What is STATSPACK tool?
1.display list of all users from ur data base.what is the query?
How to create an oracle database manually?
how to i write the query 'NISHI' TO N I S H I
4 Answers Attra, Metric Stream,