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

What is bulk compiling in pl/sql.?

585


Is it possible to include an insert statement on the same table to which the trigger is assigned?

532


Why do we need sharding?

493


what is view? : Sql dba

544


How does sql*loader handles newline characters in a record? : aql loader

560






What are the advantages of sql?

531


What are the types of join and explain each?

554


How do you know if a relationship is 2nf?

491


What is the advantage of index in sql?

515


Can a table have no primary key?

521


What is the difference between sql and isql*plus?

492


What is the difference between stored procedure and view?

504


What is sql used for?

612


What are the types of records?

503


What is sql comments?

632