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

How to read xml file in oracle pl sql?

496


How to get each name only once from an employee table?

591


What are the query optimization techniques?

519


how many columns can be used for creating index? : Sql dba

505


What is vector point function?

551






What has stored procedures in sql?

583


What is varchar example?

556


How sql query is executed?

542


What is normalization sql?

499


what is schema? : Sql dba

549


What is the largest value that can be stored in a byte data field?

510


What is sql*loader?

560


What is lexical units in pl sql?

556


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

547


How delete a row in sql?

524