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.

Tags: Database

Similar Questions

  • What is the best way and to share data between a server and a Client app?

    Hello

    I'm trying to communicate a Client-Server application.

    In fact, I already have a simple data transfer via TCP/IP. However, I don't know yet, if TCP/IP is the best (and by that I mean, better, faster, safer, etc.)

    How to do.

    What are the cons and Pros between TCP/IP, STM and shared Variable?

    Do you recommend another type of communication in addition to these 3?

    Thank you

    Matt.

    In my view, that a general question cannot have a response says.

    Then, there is no way 'the best' for sharing data between a client and a server app.

    I like to use TCP/IP, but sometimes (when data loss is not critical) I use UPD (quick and dirty).

    I generally avoid shared variables, especially on embedded devices.

    Some other times I have I like to Exchange data in a database...

    A few other times I Exchange data using file...

    Marco

  • What is the Differenc between classical planning and EPMA

    Hi all

    What is the difference between classical planning and EPMA in terms of functionality. If we choose the EPMA, what are the additional benefits that we will get more classic?

    Please explain in detail medium.

    In what scenarios, we will for the classic planning and of EPMA (we do not use financial management. Only, planning, Essbase and EN)

    Please suggest me. We use the 9.3.1. Customer wants to leverage Hyperion in the future.

    Thanks in advance.

    Kind regards
    Konrad.

    EPMA is really just an improved graphical interface for managing metadata, applications and data synchronizations.

    It is not the most stable piece of software in the 9.3.1 and my preference would be to conventional planning.

    See you soon

    John
    http://John-Goodwin.blogspot.com/

  • Explain the relationship between libraries, albums and photos in pictures.  Where are the images stored?

    Looking for info on the relationship between libraries, albums and photos in the Photos app.  I can create several libraries containing photos and unique albums.  Can I put the same photo in libraries and the different albums?  By making a copy it creates a link to the original or a new photo?  Where are located the photo files?  When scanning photo to my Mac Pro files are placed in a folder structure, copy these photos in an album Photos using the original file or he places a copy in a database?

    Bottomline, I'm frustrated by the method of collection, the albums, the place and date.  I want store related photos in a separate album.   Example: A library for a family, containing albums of members of their family. Maybe the photos have duplicate in different albums.

    Some of your questions are answered by Leonie contributor in this thread:

    Re: Too many libraries...

    More answers can be found by using help in Photos app, or in general to help the Viewer.

    Apple Support website has links to information in articles; a search on the web is sometimes useful

    to locate the Apple pages faster than the company's site. Others in line include:

    Photos for OS X FAQ:

    http://www.IMore.com/photos-OS-x-FAQ

    How to use the Photos for OS x:

    http://www.IMore.com/how-use-photos-OS-x-ultimate-guide

    Good luck!

  • I followed the instructions to set up the home between my Mac and iPhone sharing 6, but I don't understand all the music on my iPhone

    I followed the instructions to set up the home between my Mac and iPhone sharing 6, but I don't understand all the music on my iPhone

    I have confirmed:

    (1) devices are on the same network

    (2) I am connected to my AppleID with the same account

    3) are my OS up to date (Mac 10.11.2) (9.2 iPhone)
    (3) I closed iTunes and the App has reopened

    (4) I turned my iPhone off and rebooted (and confirms the foregoing)

    On my iPhone, I see in my music library, different ' kind' listed (e.g., classic, recently added, music of the 1990s, etc.) but they are all empty.

    Im hoping to see the music I have in iTunes on my Mac and play these songs on my iPhone.

    IM thinking, music that would be shared from my computer to my phone will be on the cloud?

    (I did not all default to add my music in the cloud at the moment).

    Post edited by: abbeyinor

    Did you go into settings > music on your phone and sign in home sharing?

    See you soon,.

    GB

  • What is the difference between an application and a widget?

    I'm a newbie trying my Tablet cleaning. to start:

    What is the difference between an application and a widget?

    Widget-based applications

    not always asked of widgets

    Widget is just an application interface to develop android home and have some readily available settings/info/etc.; If you do not need to type an application to access some of the data; but you can type the widget to run the application if necessary and if possible.

    It's like a windows program, you must run it to use it... If they is not a widget.

  • What is the difference between Foglight JavaEE and Foglight JMX monitoring?

    Hello

    I have a plan to monitor the 6.1.0.17 WebSphere Application Server (32 bit) and 7.0.0.5 (64-bit)

    But I understand not all Foglight for JavaEE and Foglight for JMX.

    Foglight for JavaEE or Foglight for JMX is able to monitor WebSphere?

    What is the difference between Foglight JavaEE and Foglight JMX monitoring?

    Thanks in advance

    Jeans

    Just to add to the excellent answers already posted.

    We have 2 agents which allows you to monitor Java:

    1. a JavaEE agent that runs inside the JAVA virtual machine and the information of both JMX and instrumentation.

    This Agent will give you JMX information like information of JVM (use of the bunch, son etc.), of the Application and server availability information and other information of JMX/PMI (connections pools, pools of ejb, servlets, jsp, JCA and more).

    Java EE & # 039agent also gives you information of the instrumentation - RFA count and response time, exceptional output and timeout information, distribution of queries (App/DB, component technology, server, application failure), object tracking, transaction flow and stransactional between servers and data sources) and ask traces (the ability to see the trees of the RFA at the method level to know where things are slow/stuck).

    2 JMX agent is running outside the JVM but can run on the same computer or on a remote computer, this agent requires access active, JMX. This agent gives you information JVM, availability server/applications, as well as some data as the application server published using JMX (pools of connections, JCA, EJB, servlets, etc.). The JMX agent also gives you the ability to see a list of the mbeans, get the data they expose (javaEE agent gets only a predefined list (same list that is used as a template for the application servers in the JMX agent)).

    Hope this helps

    Golan

  • What is the difference between Unicast RPF and Reverse Path Forwarding?

    I am confused between Unicast RPF and Reverse Path Forwarding function.

    What is the difference between Unicast RPF and Reverse Path Forwarding?

    Because they have all two please check the address of the source of each package before sending it to the destination too?

    Reverse Path Forwarding is used only when the network want to build a tree shared multicast communication and then we must use Unicast RPF after creation of the shared tree?

    The mechanism of the RPF is mainly used to ensure no loop of routing traffic.

    As you probably already read, it does by ensuring that his route to the source address of a packet received is accessible via the same interface that the packet is entered in the. Think of the notion of "root port" in STP. all root ports are similar to the root, sunflower follow the Sun. Therefore, it is naturally a loop prevention mechanism.

    With multicast traffic, it is quite likely to create multiple loops of routing the nature of 'destination' traffic. For this reason, using a mechanism as the RPF to ensure you are on the "road to the root" (to say) to the source originating multicast traffic. Otherwise if you're not then you either receive this traffic route in a loop, or a suboptimal path.

    uRPF works essentially the same way, except that it is done for unicast traffic instead. Now with unicast traffic your flow is from a source and directs to a single destination. Given that, as the fact that you are using a dynamic routing algorithm (which allows to select the path to a destination), you can have loops of your network for unicast traffic flow routing; of course there may be exceptions to pitfalls of configuration route redistribution.

    However RPF when it is applied to traffic unicast can add another advantage, and it's verification IP source. That's why we can use it as a security mechanism to ensure that data are from where it is supposed to come.

    On the limit of the L2, you then have mechanisms such as guard source IP to ensure that the correct host is not usurpation of their IP address.

    By analogy RPF can be used for checking at source for multicast traffic, and it is intrinsically that however, the most important role is so that it can be used to guarantee without loop routing of multicast traffic.

    I hope that helped clear things upwards and not confused you any more with all this.

  • MaxL Script to clear the data between two dates

    Hi all

    I need advice to clear the data between two dates, I have three dimensions in my sketch, 'eno', 'hiredate' and the 'actualamount '.

    Now I need to erase the data between the date range, up to now, I have this script,

    Fix ("HireDate", "Eno")

    Difficulty (@relative ("00:00:00",0),@relative("eno",0)) 2015-07-15 "))

    CLEARDATA "sal."

    endfix

    ENDFIX

    These scripts only clears on a specific day, but I tried to write the script to clear between two dates, I surfed on a few sites, but no clear answers, finaanly came here, kindly help in this regard.

    Thanks in advance.

    Have you not tried the format of "startdate":"enddate" for example "August":"September."

    See you soon

    John

  • SQL query to get the dates between two dates

    Hello

    We have a chart with start date and end date... Now I need to get all the dates between the start date and end date...

    Table looks to below...

    Create the table date_table (start_date, end_date date);

    The table data will be as below:

    start_date end_date

    January 1, 2013 January 4, 2013

    February 1, 2013 February 3, 2013

    ...............          .................

    ...............          ..................

    ...............           .................

    May 1, 2013 may 3, 2013


    I want a result like below...


    holiday_dates

    January 1, 2013

    January 2, 2013

    January 3, 2013

    January 4, 2013

    February 1, 2013

    February 2, 2013

    February 3, 2013

    .................

    .................

    .................

    .................

    May 1, 2013

    May 2, 2013

    May 3, 2013


    Can anyone help... ?

    Ramesh9158 wrote:

    Hello

    Your query will not work for our case...

    First... We do not know the number of rows in the table... If we cannot use the union...

    Second... hard coding of dates... but we do not know what could be that goes back in the table... it could be no matter what it takes not only as appearing to the interpreter...

    Hey riri.

    My code will work everywhere I use with with union all statement to create the example data.

    Try the query:

    -The main query

    Select d1 + row_number() over (partition by iden) - stopped by iden holiday 1

    Of

    connect by level<= d2="" -="" d1="" +="">

    and prior iden iden =

    and prior sys_guid() is not null

    ----

    Ramin Hashimzade

  • 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.

  • How can I get the lines for the date between 2 different days

    Hi all,

    How can I get the lines for the date between 2 different days.

    Sample data:
    Table name: Articles
    Title start_date end_date
    Heading1 08-22-2011 2011-09-11
    2011-08-01-2011-09-01 Title2
    Title 3 2011-08-21 08-21-2011
    title4 2011-08-28 2011-09-11

    Result will be:
    Title start_date end_date
    Heading1 08-22-2011 2011-09-11
    2011-08-01-2011-09-01 Title2
    title4 2011-08-28 2011-09-11

    This is my example query:
    SELECT * FROM items WHERE trunc (es.date_start) > = TO_DATE('2011-08-22', 'YYYY-MM-DD') AND trunc (es.date_end) < = TO_DATE ('2011-08-28', 'YYYY-MM-DD')

    but I can not get the expected results. Any help would be much appreciated.

    Thanks in advance

    not read your question properly before...

    Please try this

    Select * FROM items
    WHERE (TO_DATE ('2011-08-22', 'YYYY-MM-DD') between TRUNC (es.date_start))
    AND TRUNC (es.date_end)) OR
    (TO_DATE ('2011-08-28', 'YYYY-MM-DD') between TRUNC (es.date_start))
    AND TRUNC (es.date_end))

  • What is the difference between Pro Acrobat and LiveCycle Designer 8.1ES?

    Hello

    What is the difference between Pro Acrobat and LiveCycle Designer 8.1ES?

    Thank you

    Hello

    They are two different programs.

    Acrobat

    This can be used to generate other types of document native PDF files. In addition, you can create forms that are called AcroForms. These retain most of the functionality that looks like in Acrobat to comment on.

    The form IS a PDF file.

    Acrobat is avialable for Windows and Mac.

    LiveCycle Designer

    This program is used to develop forms and is completely separate from Acrobat. The forms are called XFA forms, which means XML Forms Acrhitecture. The focus is quite the processing of data.

    While the forms that are created in the designer of the LC can be opened in Acrobat (Reader), they are not native PDF files and some of the features normally is not available. For example, while you can add data to the fields when the form is opened in Acrobat, you can not change the form itself in Acrobat. If you want to change the form, you will need to open again in LC Designer.

    It comes with the Windows of Acrobat Pro version. There isn't a Mac version of LC Designer.

    It's a broad overview brush, it could be useful.

    Niall

  • 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.

  • What is the difference between v$ datafile and v_$ datafile?

    of http://download-uk.oracle.com/docs/cd/B19306_01/server.102/b14237/dynviews_1076.htm

    v$ datafile contains data file information in the control file

    So what is the difference between v$ datafile and v_$ datafile.

    Under what circumstances should we use v$ datafile and under what circumstances we used v_$ datafile?

    Thank you!

    So what is the difference between v$ datafile and v_$ datafile

    The first is a synonym for the second, you can check from your database:

    SQL> select object_name,object_type from all_objects where object_name in ('V$DATAFILE','V_$DATAFILE');
    
    OBJECT_NAME                    OBJECT_TYPE
    ------------------------------ -------------------
    V_$DATAFILE                    VIEW
    V$DATAFILE                     SYNONYM
    
    SQL> select table_name from all_synonyms where synonym_name='V$DATAFILE';
    
    TABLE_NAME
    ------------------------------
    V_$DATAFILE
    

    In general, V$ view mean $ V_.

    Nicolas.

Maybe you are looking for