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 to convert characters to numbers in oracle?
The table has 3 columns 4 rows. The output is which column has least null values( A COL SHOULD BE THE OUTPUT) Write the query plz. A B C ================ 1 NULL 2 NULL 3 4 NULL 5 6 7 NULL NULL O/P C = 2 4 6
Can anyone give me information about oracle certification
how to use select statement as formal parameter in procedure specification?(someone said that using string) ex:-procedure(a in number,select ename from emp ) i am asking syntax like this?
Explain view?
What is oracle and what are its different editions?
What is oracle instant client?
What are the uses of Rollback Segment ?
candidate key is subset of super key but not vice-verse explain
What is the difference between 10g OEM and 11g OEM?
What is an oracle transaction?
how table is defined in plsql table? how can i select column from plsql table? can i use select * from plsql table type?