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!

Interested in getting your voice heard by members of the Developer Marketing team at Oracle? Check out this post for AppDev or this post for AI focus group information.

Create a List of Weeks

Joe RMar 14 2025

Version: Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production

Hello,

I need help to create a query to display a list of weeks that will be used as a List of Values in APEX (23.2) which requires a “Display” value and a “Return” value.

So, at the time of this post it was week 37. The list of weeks would be 1 to 37. Next week the list would be 1 to 38 etc. When it's Leap Year then week 53 would be in the list when that week became the current week.

I came up with a query to get all 53 weeks, but the request is to display this list as described. Can someone help me with creating this query?

The query I found for displaying all 53 weeks is:

SELECT LEVEL week_number, LEVEL
FROM dual
CONNECT BY LEVEL <= 53;

Please let me know if you have any questions.

Thanks,

Joe

This post has been answered by Hub Tijhuis on Mar 14 2025
Jump to Answer

Comments

Post Details

Added on Mar 14 2025
3 comments
101 views