• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1714
  • Last Modified:

First day of every month of all twelve months in one query..

How do I get first day of every month of all twelve months in one single query
0
d27m11y
Asked:
d27m11y
  • 2
1 Solution
 
sdstuberCommented:
assuming you mean for the current calendar year, try this...


    SELECT NEXT_DAY(ADD_MONTHS(TRUNC(SYSDATE, 'yyyy'), LEVEL - 1) - 1, 'Friday')
      FROM DUAL
CONNECT BY LEVEL <= 12
0
 
sdstuberCommented:
I'm not sure why, but I thought that question read get the first Friday of every month
If it's just the first of each month, that's even easier


   SELECT  ADD_MONTHS(TRUNC(SYSDATE, 'yyyy'), LEVEL - 1)
      FROM DUAL
CONNECT BY LEVEL <= 12
0

Featured Post

The new generation of project management tools

With monday.com’s project management tool, you can see what everyone on your team is working in a single glance. Its intuitive dashboards are customizable, so you can create systems that work for you.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now