How to display all Friday's in a year with date?

Answer Posted / dinesh

DECLARE
c date:='01-JAN-15';
d date:='31-DEC-15';
a number(10);
BEGIN
a:=d-c;
FOR i in 1..a
LOOP
IF to_char(c,'DY')='FRI' THEN
DBMS_OUTPUT.PUT_LINE('THIS IS FRIDAY DATE:='|| ' '|| c);
END IF;
c:=c+1;
END loop;
END;

Is This Answer Correct ?    3 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Is drop table faster than truncate?

547


what is the difference between group by and order by in sql? : Sql dba

596


what is a primary key? : Sql dba

552


what are the advantages and disadvantages of cascading style sheets? : Sql dba

544


what does myisamchk do? : Sql dba

552






which operator is used in query for pattern matching? : Sql dba

541


what are date and time intervals? : Sql dba

562


What is the difference between database trigger and stored procedure?

549


Explain what is a column in a table?

569


What is crud stand for?

561


How do I pipe the output of one isql to another?

530


What is output spooling in sql*plus?

545


Write a sql select query that only returns each name only once from a table?

562


Is left join faster than join?

536


Explain the rollback statement?

570