Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7040679
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T01:56:49+00:00 2026-05-28T01:56:49+00:00

I have build a view with following query. SELECT TRUNC(sysdate – (365), ‘YYYY’) +

  • 0

I have build a view with following query.

SELECT TRUNC(sysdate - (365), 'YYYY') + (level-1) AS the_day
  FROM dual
    CONNECT BY level <= to_number(TO_CHAR(last_day(add_months(TRUNC(sysdate, 'YYYY'),11)), 'DDD'))

above query return output like below.

THE_DAY
---------
01-JAN-11
02-JAN-11
03-JAN-11
04-JAN-11
05-JAN-11
06-JAN-11
07-JAN-11
08-JAN-11
09-JAN-11
10-JAN-11
11-JAN-11

...

20-DEC-11
21-DEC-11
22-DEC-11
23-DEC-11
24-DEC-11
25-DEC-11
26-DEC-11
27-DEC-11
28-DEC-11
29-DEC-11
30-DEC-11
31-DEC-11
01-JAN-12

This is January of 2012. so i need to remove all days from 01-JAN-11 to 31-JAN-11 from above output and add all days from 01-JAN-12 to 31-JAN-12 to output.

how can i do this ? how should i modify my query for get result like below.

THE_DAY
---------
01-FEB-11
02-FEB-11
03-FEB-11
04-FEB-11
05-FEB-11
06-FEB-11
07-FEB-11
08-FEB-11
09-FEB-11
10-FEB-11
11-FEB-11

...

20-DEC-11
21-DEC-11
22-DEC-11
23-DEC-11
24-DEC-11
25-DEC-11

...

01-JAN-12
02-JAN-12
03-JAN-12
04-JAN-12
05-JAN-12
06-JAN-12
07-JAN-12
08-JAN-12
09-JAN-12
10-JAN-12
11-JAN-12
12-JAN-12
...
30-JAN-12
31-JAN-12
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-28T01:56:49+00:00Added an answer on May 28, 2026 at 1:56 am
    SELECT add_months(TRUNC(sysdate - (365), 'YYYY'),to_number(to_char(sysdate,'mm'))) + (level - 1) AS the_day
      FROM dual
    CONNECT BY level <=
               to_number(TO_CHAR(last_day(add_months(TRUNC(sysdate, 'YYYY'), 11)),
                                 'DDD'))
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a situation where I build a view with a table and another
Why is using '*' to build a view bad ? Suppose that you have
I have a Monthly Status database view I need to build a report based
I have a small problem with UINavigationController animation between two view. My application build
I have an user view model that has the following properties: public User user;
In a view I have the following: <% @top_posts.each do |post| %> <li> <%=
How do I build the following view? I want to build a form using
I created a Materialized view using the following code: CREATE MATERIALIZED VIEW M_USER_HIERARCHY BUILD
I would like some recommendations on the following situation: I have to build a
So I have the following scenario: I have a class part of a view

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.