Choose the date

Hello

I need to select all dates between two dates. This selection is plu query subquery, return of rows of data per day (month or year) between two dates.
I use object and trunc (sysdate + rownum) for select dates.

Is it posible to optimize this somehow? For example, use the stored procedure that generates all the dates between the two parameters. Please tell me how to do it.

Thanks and greetings

Hello

CONNECTION BY and double is faster than ROWNUM and a large table.
Try this:

SELECT     p_from_date + LEVEL - 1
FROM     (
          SELECT     DATE '2009-10-01'     AS p_from_date
          ,     DATE '2010-07-01'     AS p_to_date
          FROM     dual
     )
CONNECT BY     LEVEL <= 1 + p_to_date
                        - p_from_date

If you build only a few hundred dates, then it would not significantly faster.

Tags: Database

Similar Questions

  • When I buy Creative Cloud, can I choose the date when my 1 year subscription starts?

    Then it starts on the date of purchase creative cloud or can I choose the date beginning myself, for example 2 months after I bought initially creative cloud?

    It starts as soon as Adobe responds to your order. In practice, the date that Adobe receives your first payment.

    I've never seen an option to offer a start date.

    Using creative cloud | Creative cloud / Common Questions

    When does my membership start?

    If you purchase your membership directly from Adobe's Web site, it starts as soon as the order is respected by the Adobe Store. First connect to your account.

    If you buy your individual membership to a participating retailer or an online store, it starts as soon as you enter your purchase on creative.adobe.com and click on Get Started.

    If you buy a membership to team from a reseller, the terms of membership begins when you add seats to your account.

  • Choose the date between December 1 and March 1

    I have a table in which I include the date column and the temperature.

    Now, I want to choose the average temperature per season per year. For the spring until autumn, it's perfectly feasible:

    But what about winter. Winter begins December 1st and ends March 1 of next year. Can someone help me?

    The result in plain language should be:

    Select the year (deducted from 1 December), avg (temp) of weatherdata if date between 01-dec-current_year and 01-March-next_year.

    year - avg (temp)
    2010 - 5 (from December 2010 1 until March 1, 2011)
    2011. 1 of dec 1, 2011 until March 1, 2012)
    2012-3 from December 2012 1 up to March 1, 2013) will be in the future.

    Published by: dkoetsier on August 31, 2012 05:15

    I never suggested to the group only by reference. I geve suggestion you how to calculate the name of season. Of course, you also need this season belongs to which is:

    TO_CHAR (ADD_MONTHS (Datum,-2), 'YYYY')

    Here are the two pieces of data that must be grouped together. In order to obtain the average temperature in season:

    select  case to_char(add_months(datum,-2),'Q')
              when '1' then 'Spring'
              when '2' then 'Summer'
              when '3' then 'Fall'
              else 'Winter'
            end || ' of ' || to_char(add_months(datum,-2),'YYYY') season,
            avg(temp)
      from  weerdata
      group by to_char(add_months(datum,-2),'YYYY'),
               to_char(add_months(datum,-2),'Q')
    /
    

    SY.

  • Unable to choose the Date when you try to schedule

    Hello
    I created a report with date setting where I can choose a date before to display the report, but ehrn I am planning the report that I am not able to select the date but I not see the parameter here but doen't calendar pop up... any suggestions please...

    It is an Oracle BI publisher Bug in 10.1.3.4.1... this should work in Firefox... I'm wrong? His problem in IE 7.0

  • When choosing the date on a banking site a box appears telling me to use one to several date to date.

    I am trying to get a report from a bank site and a box appears asking me to pick a plu date of date. I have the correct date. Is there a fix or outside around it.

    Check the date and time of the clock on your computer: (double) click on the clock icon in the Windows taskbar.

  • Choose the date of the table

    Hello

    It comes to my table
    CREATE TABLE TEMP_LEAP
      (
        "DATE_FROM" DATE
      )
    Insertion of the data in it with the procedure which takes 2 parameters of date format:
    CREATE OR REPLACE
    PROCEDURE  "T_PROC" (p_dat_from date, p_dat_to date) IS
    BEGIN
    
    
    DECLARE
    
      day       number     := 0;
      st           NUMBER := 0;
    
    BEGIN
    
    day := p_dat_to+1 - p_dat_from; 
    
    for p in 1 .. day     
               
    loop   
                    
       insert into temp_leapp (date_from) values (p_dat_from+st);    
                    
        st := st+1;  
                  
    end loop;  
               
     commit; 
    END;
    END;
    Now lets fill in the data in the table:
    execute T_PROC(TO_DATE('01.01.2010','DD.MM.YYYY'),TO_DATE('17.08.2013','DD.MM.YYYY'));
    Data are now filled in the table.

    I want to do is do a select statement that will make the following output data:
    01.01.2010 - 31.12.2011
    01.01.2012 - 31.12.2012
    01.01.2013 - 17.08.2013
    I want is to get the leap year if there is a. I only need of days in the year, so don't mind the months.

    I need to check if there is a leap year in considering the p_dat_from and p_dat_to.

    If it isn't then you will get a single record of our instruction select and values will be made of: p_dat_from - p_dat_to.

    If there is a leap year in our period we will arrive after statements (example above).

    01.01.2010 - 31.12.2011 <-first date is p_dat_from and second is the last day before the leap year
    01.01.2012 - 31.12.2012 <-this is leap year. First date is the beginning of the leap year and the last date is the end of the leap year or p_date_to (if it ends in leap years).
    01.01.2013 - 17.08.2013 <- and this is the period after the leap years.

    It is a piece of code that I fell or with up to now:
    SELECT
    MIN(date_from),
    MAX(date_from)
    FROM temp_leap
    WHERE remainder(to_number(to_char(date_from,'yyyy')),4) = 0
    union
    
    SELECT 
    
    MIN(date_from) over (partition by to_char(date_from,'yyyy')),
    MAX(date_from) OVER (PARTITION BY to_char(date_from,'yyyy'))
    FROM temp_leap
    WHERE remainder(to_number(to_char(date_from,'yyyy')),4) <> 0
    
    ORDER BY 1,2;
    OK, that's all. I hope that its understandable that I do.
    If you have a questions please ask away.

    PS is there anything I need to do. You don't have to bother with the questions "what i February is after before etc." I don't love about it. All the other logic is already fixed all I need is what I wrote above.

    Thank you.

    Published by: BluShadow on March 14, 2013 08:24
    Fixed barcode labels

    Here's a way...

    SQL> create table temp_leap(date_from DATE)
      2  /
    
    Table created.
    
    SQL>
    SQL> insert into temp_leap
      2  select date '2010-01-01' + rownum - 1
      3  from dual
      4  connect by rownum <= (date '2013-08-17' - date '2010-01-01') + 1
      5  /
    
    1325 rows created.
    
    SQL>
    SQL> commit
      2  /
    
    Commit complete.
    
    SQL> ed
    Wrote file afiedt.buf
    
      1  select min(date_from)||' - '||max(date_from)
      2  from
      3        (select date_from
      4              ,sum(leap_yr_switch) over (order by date_from) as leap_yr_switch_cnt
      5        from (
      6              select date_from
      7                    ,case when lag(leap_yr) over (order by date_from) != leap_yr then 1 else 0 end as leap_yr_switch
      8              from (
      9                    select date_from
     10                          ,case when mod(to_number(to_char(date_from,'YYYY')),400) = 0
     11                                 or (    mod(to_number(to_char(date_from,'YYYY')),4) = 0
     12                                     and mod(to_number(to_char(date_from,'YYYY')),100) != 0
     13                                    )
     14                           then 1 else 0 end as leap_yr
     15                    from temp_leap
     16                   )
     17             )
     18       )
     19  group by leap_yr_switch_cnt
     20* order by min(date_from)
    SQL> /
    
    MIN(DATE_FROM)||'-'||MAX(DATE_FROM)
    -------------------------------------------
    01-JAN-2010 00:00:00 - 31-DEC-2011 00:00:00
    01-JAN-2012 00:00:00 - 31-DEC-2012 00:00:00
    01-JAN-2013 00:00:00 - 17-AUG-2013 00:00:00
    

    Published by: BluShadow on March 14, 2013 08:51
    a slight correction in the calculation of the leap year, forgotten 100 years being does not leap.

  • How do you choose the data in tables using EBS web page?

    Hi friends,


    I'm in the URLs of the web pages EBS 11i > http://vision.abc.com:8000.
    using the SA account.

    Is there a counter part based on web module/menu to display the data in the table?

    As
    Select * from fnd_tables;
    or
    Select * from po_vendors;

    something like that which allow the display of data


    Thank you very much

    Yes, but I want a web tool that uses the URL, not the client server those. :), which are not allowed by the security check.

    As a development tools, I believe that developer SQL and TOAD (in addition to SQL * more) are what you need (although these are client/server tools).

    Oracle Enterprise Manager is a good tool tracking (but not for development), as a DBA you use EM, and access it via a URL.

    I might not necessarily use sqlplus command. but a program stored as programs simultaneous fnd.

    There is no standard concurrent requests that can help achieve this goal.

  • I am building a system and I need to help experts to choose the data acquisition card.

    Hello world

    I am currently working on a design project I need to take a data acquisition card that responds to the output of the amplifier. I'll build a force detection system which I have taken the following as detector and amplifier:

    http://content.Honeywell.com/sensing/Sensotec/pdf_catalog08/008834-1-EN_Model_UV%20Bridge.PDF

    http://content.Honeywell.com/sensing/Sensotec/pdf_catalog08/008638-1-EN_Model_53.PDF

    Please recommend me which data acquisition card I could take. The only requirement I ask is to have less than 0.1% global uncertainty.

    Thanks for anyone who can help

    Since your amp has - 3db at 7 kHz and you need only 10 bits 0.1% will do almost any card with.   USB-6009 is the lower end. USB-6210 the next step.

    Then take a look at some other boundary conditions: do you need it calibrated? (Is there a QM adj. who could ask questions?) Space?, EMC/noise, entry, differential

    Take a look at the USB-9237 with a conditioner bridge construction...

  • Windows 8 xcopy /d - does not choose the date of the day, just copy everything

    Hello

    I am running Windows 8 and use the command xcopy to save a number of directories. When I used the /D switch in the past (with no date), it would only copy the files that are newer than the target date of the mod file.

    In Windows 8, it does not. If I use / d with no specific date, it copies just everything. The only way to make it work is to specify the current date, while it works.

    I'm doing something wrong, or is this a bug in xcopy to win 8?

    Hi Chris,

    Your question is better suited for the TechNet. Please post your question in the forum TechNet Script. You can follow the link to your question:

    http://social.technet.Microsoft.com/forums/scriptcenter/en-us/home?Forum=iTCG

    Thank you.

  • Choose the date of the last

    Hi all

    I want to ask that I had a column called readingtimestamp and it has about 40 lines, but I want to select the last date given and as matter of fact that he should give me an answer. How I do that?

    Concerning

    Try this

    select column1,column2,readingtimestamp from
    (
    select column1,column2,readingtimestamp,row_number() over (order by readingtimestamp desc) rn
    from table_name) a
    where a.rn = 1;
    
  • Move the data from Palm Z22 for palm M125

    My Palm Z22 batteries do not hold a charge.  I recently bought a Palm M125, but have been unable to transfer data from the Z22, the M125.  My op system is Windows Vista Ultimate 32-bit Edition processor.  Is it possible to move the data?

    If the Z22 still works, the best way to transfer your data is for her beam to the M125.  At least, for the PIM of Palm of basic data (e.g., calendar, Contacts, memos, to-(tasks)).   On the Z22 in calendar, switch to the display of the day (not the order of the day).  In the menu, select the category of beam, choose the date range and select all from the drop-down list category.  Make sure that receiving IR is selected in the receiving device.  Align them face to face on one foot out and tap the beam.

    In Contacts, select the category in the upper right, then open the Menu and select the category of beam.  Same process for tasks and memos.

    Data and third-party applications might not let u their beam.   In addition, you will a newer device a lot older with an older operating system that may not work new apps.  So, after you transfer your PIM data, try beaming your third-party apps at a time to see if they run again.  The Z22 Launcher screen (at home), open the Menu, and then select the beam.  Highlight apps one at a time and try to beam at the M125.  My guess is that apps like Documents To Go might not even run, if they let u beam, because they were written for the newer versions of Palm OS than what works the M125.

    There is also an upgrade process where you can do this thru Palm Desktop when you switch devices.   But again because once you go towards the back to an older device, there are some compatibility issues with the applications, databases and files of the system, not to mention the questions according to what version you use Palm Desktop.

    Let us know if ensoupler works, or if you encounter any problems, in this case, we can go to the ugrade process.  Also, let us know what version of Palm Desktop you will synchronize with.

  • How can I change the date and time on my HP officejet pro

    How can I change the date and time on my HP Officejet pro?

    I'll be gald to help you in this situation.

    What officejet do you have?

    You can go to the settings on the printer screen.

    1. click on Setup

    2. click on Preferences

    3. choose the Date and time

  • Setting the Date &amp; time of printer

    Using the integrated Web server, the time displayed is 4 hours later at the present time. I walked at the exact time in the hh: mmS format but when he chooses to apply, I get an invalid format error. I have a printer HP Officejet Pro 8600 N911a. When you send as a fax is no stamp date or time on the confirmation page printed.

    bob_retired wrote:

    Using the integrated Web server, the time displayed is 4 hours later at the present time. I walked at the exact time in the hh: mmS format but when he chooses to apply, I get an invalid format error. I have a printer HP Officejet Pro 8600 N911a. When you send as a fax is no stamp date or time on the confirmation page printed.

    Hi, Bob! You can change the date and time on the front panel of the printer. If you are on the screen, just press the right arrow and then press Setup, tap preferences and then choose the Date and time.

  • Then the validation of a detail or form based on the date picker - upper effective Date?

    Hi, creates a BP custom with the effective date in field added to my details form or higher. Can I have a set of validation rules up for my top of or the form detailed such as the effective date cannot be greater than the current date? Thanks in advance.

    For the decimal amount, you need to change the formula type, the default value is a numerical formula, but you must choose the date difference. This is the online help:

    To create a date-difference formula

    1. Open the form that contains the field for which you want to create a formula. The form designer window opens.
    2. In the form designer window, select the date field that you want to create the formula. When the calculation is performed, this field appears as read-only on the form and will automatically update each time that the fields that make up the formula change.
    3. Click the formula button. A creation of the formula window opens.
    4. In the formula field Type, choose the difference in Date in the list. The window expands to show additional fields, as shown in the table below.
    5. Click OK to save your changes and close the window.

    In this area:

    Follow these steps:

    Last Date

    Click on the arrow down. uDesigner displays the list of all numeric fields on the form. In this list, choose the field that contains the later of the two dates that will be used in the calculation.

    Earliest date

    Click on the arrow down. In this list, choose the field that contains the first of the two dates that will be used in the calculation.

    Calculations based on

    Choose the calendar days to include all days of the week in the calculation. Choose the days of work to use only the working days of the week in the calculation.

  • local storage in the data store

    I have 4 ESXi 5.5 cluster nodes (host1, 2... 5) + 3par storage, I noticed that the local drive of host2 is detected as a data store.

    When I create a VM and I choose the data store, I can see all data related to my on3par LUN stores but it seems this drive local host2 too!

    I would like to remove it! Can you offer me please?

    You must hide hide this data store using permissions, you must run the following procedure: Open-> inventory-> warehouses vSphere-> select the select data-> permissions VMFS store-> click the user or group in the list and set them to 'No access' - are not propagated.

    Once achieve you its judgment showing everywhere.

Maybe you are looking for