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 a system versioned table?

702


Explain what is table in a database?

783


What is relationship? How many types of relationship are there?

789


Does truncate table reset auto increment?

722


What are the types of subqueries?

768






Is foreign key mandatory?

716


what is the use of set statement in tsql? : Transact sql

740


What is cte sql?

718


how can we destroy the session, how can we unset the variable of a session? : Sql dba

729


explain the difference between delete , truncate and drop commands? : Sql dba

745


How do you copy a table in sql?

753


What is a sql*loader control file?

790


How to install oracle sql developer?

772


Does mysql_real_escape_string prevent sql injection?

693


Explain polymorphism in pl/sql.

820