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 'trigger' in sql? : Sql dba
In a distributed database system, can we execute two queries simultaneously?
What are the sql versions?
how can we know the number of days between two given dates using mysql? : Sql dba
What is nvl?
Explain the difference between sql and mysql.
What is auto increment feature in sql?
What are analytic functions in sql?
What is field delimiter?
Inline the values in PL/SQL, what does it mean.?
What does rownum mean in sql?
Table A Table B 1 1 2 1 3 1. Union & union all --> A Union B , A Union all B 2. Minus , Intersect --> A minus B , B Minus A , A Intersect B 3. Joins A join B , A Left Join B A Right Join B , A full Join B 4. %Type - Uses & Benifit 5. Truncate & Delete 6. Pragma Autonomus Transaction 7. how to Perform DDL from function or procedure 8. Can we have DML inside Function 9. Rank & Dense Rank diffrence 10. Water Mark in Oracle 11. Index , Can we have index in all column of table if no then why ?
Can a commit statement be executed as part of a trigger?
What is difference between primary and secondary key?
how can we destroy the session, how can we unset the variable of a session? : Sql dba