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 are the advantages and disadvantages of views in a database? : Sql dba
What is sql select statement?
Does truncate need commit?
Why partition by is used in sql?
Why use truncate instead of delete?
How many rows can sqlite handle?
What is multiple columns?
1) Synonyms 2) Co-related Subquery 3) Different Jobs in Plsql 4) Explain Plan 5) Wrap 6) Query Optimization Technique 7) Bulk Collect 8) Types of index 9) IF primary key is created then the index created ? 10) Foreign Key 11) Exception Handling 12) Difference Between Delete and Trunc 13) Procedure Overloading 14) Grant Revoke 15) Procedure Argument types. 16) Functions. 17) Joins
What is varchar data type in sql?
Where is sql database stored?
What is the cause of mutating table error and how can we solve it?
What is t sql in sql server?
What is t-sql? : Transact sql
Can you select everything, but 1 or 2 fields, without writer's cramp?
What are different clauses used in sql?