Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Write a query that will display all dates of the current year, and the day of the week for each date

User_NISSYDec 10 2022 — edited Dec 10 2022
Write a query that will display all the dates of the current year, and the day of the week of each date.
 In other words, the calendar. IMPORTANT: Your query must work regardless of when it is run.
 That is, it should be universal, and not tied to October, for example. Use string multiplication

select level || to_char(sysdate, ' Month YYYY') as Dates, 
to_char (to_date (level|| to_char (sysdate,' Month YYYY')),'Day') as Day_of_week 
from dual 
connect by level<=extract(day from (last_day ( sysdate))) ;


<img src="https://objectstorage.us-phoenix-1.oraclecloud.com/p/BqK85Rn1zA5MP0vYiqbAdPgs7Z6OmMxw8SD3WCFVm5kY8uReidZ1KPIKkgJ1hCkG/n/axciphqpnohg/b/forums-legacy/o/uploads/A5SEIGDKHO78/inshot-20221210-230803301.jpg" alt="InShot_20221210_230803301.jpg">
Comments
Post Details
Added on Dec 10 2022
6 comments
2,455 views