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
Mention what is the use of function "module procedure" in pl/sql?
Is sql better than excel?
how to get @@error and @@rowcount at the same time? : Sql dba
What are %type and %rowtype for?
How global cursor can be declare with dynamic trigger ?
What is coalesce in sql?
Can a primary key be a foreign key?
How many sql statements are used? Define them.
what is a trigger in mysql? Define different types of trigger. : Sql dba
What is optimistic concurrency control? : Transact sql
What are all ddl commands?
What are the different schemas objects that can be created using pl/sql?
What is a primary key sql?
What is the difference between function and procedure in pl/sql?
What is a subquery in sql?