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

Answer Posted / nihar meher

declare
a date;
b date;
c number(15);
begin
select trunc(sysdate,'yyyy') into a from dual;
select add_months(trunc(sysdate,'yyyy'),12)-1 into b from dual;
c:=b-a;
for i in 1..c
loop
if to_char(a,'dy')='fri'
then
dbms_output.put_line(a);
end if;
a:=a+1;
end loop;
end;

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Is stored procedure faster than query?

562


What is meant by truncate in sql?

520


How long does it take to learn pl sql?

603


What are the different datatypes available in PL/SQL?

564


What is a dynamic query?

569






how many sql dml commands are supported by 'mysql'? : Sql dba

567


What is the difference between nested table and varray?

516


Which certification is best for sql?

534


how to get help information from the server? : Sql dba

526


How do you remove duplicates without using distinct in sql?

499


What is posting?

603


What is graph sql?

524


State few characteristics of pl/sql?

565


how do you know the version of your mysql server? : Sql dba

503


What is the difference between the conventional and direct path loads? : aql loader

691