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 is pragma autonomous transaction in oracle?
Q) How to Find Max Date from each Group? (Asked in Infosys (INFI)Interview)
What do the 9i dbms_standard.sql_txt() and dbms_standard.sql_text() procedures do?
What is primefaces used for?
What is archive log in Oracle?
i must get table name, constraint type, constrain name with using concads "||" and it must be in string type, then with join processes i need code please help immidiately
How to find no of saturdays in a month using single sql ?
How do you ensure database security?
What is different types of joins?
What is a sub query? Describe its types?
i can't insert column value greater than 4000 characters at one instance even i am using CLOB datatype . how to insert efficiently more than 4000 characters ? And please let me know how to impose inline and out-of line constraints on oracle column??? Thanks in Advance... Prakash
What are joins, explain all types of joins?