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 |
How many categories of data types?
hey friends, What are the steps I can do to transfer the database from Microsoft Access 2003 to oracle10g (or SQL) Best regards
what is the difference between primary key & foreign key?
57 Answers CTS, Infosys, La Multi, Sparsh, Wipro,
SELECT THE RECORDS FROM 3 TABLES LIKE(T1,T2,T3) AND HOW CAN WE INSERT THAT RECORD IN ANOTHER TABLE LIKE(T4)?
can u plz provide me oca sql dumps please i need them
Youre getting high busy buffer waits - how can you find whats causing it?
what is primary key?
How to call a sub procedure?
How to retrieve data from an cursor to a record?
How translate command is different from replace?
How to initialize variables with default values?
What is Parallel Server ?