How to find no of saturdays in a month using single sql ?

Answer Posted / 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



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Differentiate between function and procedure in oracle.

561


What is the use of oracle?

562


What is a server parameter file in oracle?

595


Can we save images in a database and if yes, how?

594


What are the differences between primary key and unique key?

515






When do you get a .pll extension in oracle?

679


What do database buffers contain?

570


What is a trace file and how is it created in oracle?

554


How to delete an existing row from a table in oracle?

647


How to define and use table alias names in oracle?

512


What is the quickest way to fetch the data from a table?

570


How to create a new table in your schema?

613


6. Display the client name and order date for all orders using the traditional method.

1753


How to change program global area (pga) in oracle?

590


What are named parameters?

616