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
What is pl sql script?
Where are my tempfiles, I don't see them in v$datafile or dba_data_file?
how to calculate expressions with sql statements? : Sql dba
What are the types of views in sql?
How would you pass hints to the sql processor?
How can we make an if statement within a select statement?
What is pl sql commands?
Can we use loop in sql?
What is an alias command?
What is relationship? How many types of relationship are there?
List the various privileges that a user can grant to another user?
Are subqueries faster than joins?
Is oracle and sql same?
How do I find duplicates in two columns?
Which are sql * plus commands?