Solved

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

Posted on 2014-03-06
2
1,231 Views
Last Modified: 2014-03-06
How do I get first day of every month of all twelve months in one single query
0
Comment
Question by:d27m11y
  • 2
2 Comments
 
LVL 73

Expert Comment

by:sdstuber
Comment Utility
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
 
LVL 73

Accepted Solution

by:
sdstuber earned 500 total points
Comment Utility
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

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
how to tune this sql query 61 100
oracle query 15 63
update set column values in oracle 3 43
Oracle Database creation fails 5 36
This article started out as an Experts-Exchange question, which then grew into a quick tip to go along with an IOUG presentation for the Collaborate confernce and then later grew again into a full blown article with expanded functionality and legacy…
Configuring and using Oracle Database Gateway for ODBC Introduction First, a brief summary of what a Database Gateway is.  A Gateway is a set of driver agents and configurations that allow an Oracle database to communicate with other platforms…
This video shows syntax for various backup options while discussing how the different basic backup types work.  It explains how to take full backups, incremental level 0 backups, incremental level 1 backups in both differential and cumulative mode a…
This video shows how to Export data from an Oracle database using the Datapump Export Utility.  The corresponding Datapump Import utility is also discussed and demonstrated.

744 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now