number of records for a period of time

My employee table has a column of type DATE hiredate.

We can see the number of records (means how many employees is hired) this table for a given start and end hiredate.
Here's the tricky part:
for the mean time March 3, 2010-March 23, 2010, I want to show how many people the results is hired each week:
result set should be:
(date for the weeks deadline is midnight Monday: like that)

week without. hired employees
----------------------------------------------------------------------------------------------------------------------------------------------------------
3 March 2010 to 08-MAR-2010 (exclusive) 5
8 March 2010 to 15-MAR-2010 (exclusive) 16
15 March 2010 to 22-MAR-2010 (exclusive) 67
March 22, 2010 to 24-MAR-2010 (means including employees hired on 23 rd) 29

How to do?

Hello!

This one will do, I tested on the emp table. In plus/minus date must be the same as the dates where the clause!

SELECT greatest(trunc(hiredate, 'IW'), to_date('06.04.2010', 'DD.MM.YYYY'))     week_start,
          least(trunc(hiredate, 'IW') + 6, to_date('26.04.2010', 'DD.MM.YYYY')) week_end, COUNT(*) hired
  FROM employees
 WHERE hiredate BETWEEN to_date('06.04.2010', 'DD.MM.YYYY') AND to_date('26.04.2010', 'DD.MM.YYYY')
 GROUP BY trunc(hiredate, 'IW'), trunc(hiredate, 'IW') + 6;

T

Tags: Database

Similar Questions

  • Up to version 7.01 FF ever hanged, but with 7.01, after having not used for a period of time (hours or less), it crashes. No solution except again?

    Up to version 7.0.1 but never crushed/hnag, FF with 7.0.1 after you have not used for a period of time (hours or less), it crashes. No solution except again?

    Upgrade your browser Firefox 8 and try

  • How to run a framework for a flat structure of sequence for a period of time?

    Hello

    I have a loop timed measuring a resistance value every 2 seconds. I wish I had this loop timed to run for a period of time (5 minutes). The timed loop itself is placed within a flat sequence so I fear that the measure will be taken once and the next picture will begin to run, without wait 2 seconds for a successive reading (and not a loop for, say, 5 minutes).

    In other words, is it possible to have a flat sequence structure frame run for awhile before moving on to the next image?

    Thanks for your help!

    JFK_Aero

    All code within a sequence must complete before can execute the following image.  So until your timed loop is configured correctly, the following image may not run until your 5 minutes is up (N = 5 minutes / 2 s/measure = 150 steps).

  • Silent mode - for a period of time only. After update to Android 6.0

    Hello

    Cannot know how to silently for a more predefined period of time. Marshmallows before we had the choice to put this silent mode should just modified for the next 30 minutes, two hours etc. It is a very nice feature for me, because too often I forgot to turn on sounds after a meeting.

    Before this feature came in the Android, I used an app that defined silent mode with a timer. Do I have to re - install an application like that?

    I found where you can set (by chance) all trying to solve my problem.

    If you access do not disturb in the menu drop-down (if it is not there then it is one of the icons you add to the grid) when you select the option it offers the possibility of no end or for a period of time time.

    I am happy I found it too since I also use it when I go to meetings.

  • U2415, artifacts monitor after power off for a period of time. Solved by allowing the DP1.2

    U2415 - artifacts monitor after power off for a period of time

    I'm running Win 8 Pro 64 bit, Asus GTX 760. Connected to the U2415 using the miniDP to DP cable.

    It is: after turning off my monitor for a period of time (PC fixed IT), 2 hours or more, after turning it back on, I see lines on the screen.

    I will need to restart the PC for it to be back to normal.

    It will not happen if I turned OFF the monitor for a short period. Only when I turned OFF for a few hours.

    Any ideas? Thank you.

    I downloaded a video on Dropbox. I had it turned on after turning off for about 3 hours.

    [See:www.dropbox.com/.../U2415.mp4]

    Hi Chris, just an update.

    A local forumer had discovered how to solve.

    It was the scene of DP1.2. By default, it is set to "Disable". After that I put to 'Activate' and test it for 2 days, everything seems fine now.

    Hopefully someone will find this useful.

    Thanks Chris.

  • mouse/key locks board increase after computer idle for long periods of time. any Advisor

    I'm having a problem with windows lock-up during idle time.  If I leave the computer for a period extended by time, most often but not always my computer crashes. In other words when I get back, my mouse or my keyboard doesn't work at all. If I left open with unsaved information programs, I lose this info because as my only alternative to get operational again is to shut down the computer manually. Can anyone provide me a help or possible solutions in order to avoid gels of this nature?

    Thank you for your help.

    This is possibly due to a slow computer errors and registry. I recommend the following.
    CCleaner - will remove the unnecessary files that you don't want

    Step 1. Download Ccleaner from http://www.piriform.com/ccleaner/download/standard
    Download it, run the file install Ccleaner, then open Ccleaner.
     
    Step 2. Click run cleaner once you have checked all you don't want on your computer. This will clean up unnecessary files, you don't want to. CCleaner also comes with a registry cleaner.

    Step 3. To run this registry click on the left side of the window, and then click scan for issues, difficulty of the selected questions, click on no to the box that opens, and then click fix all selected issues. This should clean all files that is no longer usable.

    Defragment your drive hard by: Windows Defragmenter to help. I use defraggler from the makers of Ccleaner because it defragments the individual files.

    If problems or questions please answer.
    Answer if you want to know how to install defraggler too!

  • Storage/not using the printer for a period of time extended

    I have a Photosmart 6520 printer which is not used for a period of 6 months each year.

    The last time, I removed the cartridges and stored in an airtight container. When the reactivation of the printer, it has no print at all, but after many attempts to clean and/or align the print heads, he is slowly back to normal operation.

    My question is: what is the best ink cartridges must be left in the printer or deleted during this period?

    It is best to leave them in the printer. Once these special cartridges have their orange shipcap removed, I always recommend to leave in the printer, if you go to the store for a while.

  • Difference in the number of records for the same date - 11 GR 2

    Guy - 11 GR on Windows2005 2, 64-bit.

    BILLING_RECORD_KPN_ESP - is a monthly partitioned table.
    BILLING_RECORD_IDX #DATE - is a local index on "charge_date" in the table above.

    SQL > select / * + index (BILLING_RECORD_KPN_ESP BILLING_RECORD_IDX #DATE) * /.
    2 (trunc (CHARGE_DATE)) CHARGE_DATE;
    3 count (1) Record_count
    4. IN "RATOR_CDR". "" BILLING_RECORD_KPN_ESP ".
    where the 5 CHARGE_DATE = January 20, 2013.
    Group 6 by trunc (CHARGE_DATE)
    5 m

    CHARGE_DATE RECORD_COUNT
    ------------------ ------------
    2401 20 January 13-> > some records here.

    -> > Here I can see only '2041' records for Jan/20. But in the query below, it shows "192610" for the same date.

    Why is this difference in the number of records?

    SQL > select / * + index (BILLING_RECORD_KPN_ESP BILLING_RECORD_IDX #DATE) * /.
    (trunc (CHARGE_DATE)) CHARGE_DATE,
    2 count (1) Record_count
    3. FOR "RATOR_CDR." "" BILLING_RECORD_KPN_ESP ".
    "4 where CHARGE_DATE > 20 January 2013."
    Group of 5 by trunc (CHARGE_DATE)
    6 order by trunc (CHARGE_DATE)
    5 m

    CHARGE_DATE RECORD_COUNT
    ------------------ ------------
    192610 20 January 13-> > more records here
    JANUARY 21, 13 463067
    JANUARY 22, 13 520041
    23 JANUARY 13 451212
    JANUARY 24, 13 463273
    JANUARY 25, 13 403276
    JANUARY 26, 13 112077
    27 JANUARY 13 10478
    28 JANUARY 13 39158

    Thank you!

    Because in the second example you also select rows that have a nonzero component.

    The first example selects only rows that are 00:00:00

    (by the way, you should ask questions like this in the forum SQL)

  • After the server running for a period of time, get connection errors

    Hi all

    We meet a few serious problems during the performance tests.
    Its does not occur with WebLogic 10.3 and does not occur with connections of type oracle.jdbc.driver.OracleConnection.

    After the test, the server fills up with the following exceptions...

    < 9 October 2009 15:34:17 IST > < WARNING > < JDBC > < BEA-001129 > < receipt exception creating connection to pool ' jdbc/sdoPool': IO exception: the network adapter could not establish the connection >


    Here is the configuration of the jdbc/sdoPool:
    Driver class name: oracle.jdbc.OracleDriver
    -> Properties
    user = SOL_ISMART_USER
    Class = Oracle.JDBC.pool.OracleConnectionCacheImpl
    Protocol = thin
    Initial capacity: 1
    Maximum capacity: 100
    Capacity: 1
    Delete the infected connections



    Code to get the connection...
    DataSource data source = null;

    VR;
    {
    dataSource = (DataSource) ctxt.lookup ("java: comp/env/jdbc /"+ poolName ");
    }
    catch (NamingException only)
    {
    dataSource = (DataSource) ctxt.lookup (poolName);
    }

    Connection Conn = dataSource.getConnection ();

    OracleConnection vendorConn = (OracleConnection) ((WLConnection) conn) .getVendorConnection ();

    vendorConn.setClientData ("LOGICAL_CONNECTION", conn);

    Return vendorConn;


    Here is my code to close the connection...
    If (con instanceof OracleConnection)
    {
    If (((OracleConnection) con), .getClientData (C_LOGICAL_CONNECTION)! = null)
    {
    Connection logicalCon = (connection) (con (OracleConnection)) .getClientData (C_LOGICAL_CONNECTION);

    connection - defense against leaks of output connection
    (Con (OracleConnection)) .setClientData (C_LOGICAL_CONNECTION, new Object();)

    logicalCon.close ();
    logicalCon = null;

    con = null;
    }
    on the other
    {
    con = null;
    }
    }
    on the other
    {
    If (! con.isClosed ())
    {
    con. Close;
    }
    }



    Any advice / help greatly appreciated.

    Ronan

    The DBMS does not give new WebLogic connections when running. Try to set
    the initial capacity of the pool to 35 and the login delay to 1, so the pool
    makes 35 connections at startup, one at a time, with a delay of 1 second
    between each of them. (The DBMS can sometimes get overloaded if it becomes too
    connection requests in a short period of time and don't miss some people).

  • the iPhone screen is not responding and only works for short periods of time when I use siri for an indefinite period.

    Then my phone 3 days ago started having a screen is unresponsive. I just found someone else who has the same problems as me. My screen is white and gray, flickering vertical lines at the top of my screen, sometimes extending to the bottom of the screen. My iPhone 6 s more screen shows only these lines when I use Siri for what it is, which is a little strange. To make things even more bizarre my screen becomes sensitive occasionally, but only when I'm talking about Siri for an indefinite period. One of the things I had in common with a question that someone asked who had similar problems that me was that, when these lines flickering, vertical, white and gray, the iPhone will eventually type things randomly on its own. Such as random apps or opening of the things randomly without my intervention. A unfortunate thing is that when this happens it selects things like that to end a call or facetime. I already know that the cost is $329 remedy since its considered as "other" in the apple repair options and I am also out of warranty, so I wanted to know if there is any other explanation for this. It made my phone very difficult to use these days now...

    Im going to guess that your phone is actually a 6 + and not a s 6 +, which means that your phone is suffering from simple plu epidemic of iPhones of all time - to the epidemic ic touch.  It is unrelated to Siri and tricks of the 'home', the lack of contact button that gets worse with time and flashing bars gray is the presentation of the default signature.  It's a failure level Council of integrated circuit chips that control touch and it is a design flaw in the jury of 6 + that Apple does not recognize.  You can send for microsoldering of the Board of Directors to resolve the underlying anomaly for half of the cost of your options at Apple--assuming that you are not interested in protecting your out of warranty at Apple options.

  • should I unplug iMac so that away from home for a period of time

    I'll be away from home for 6 weeks, we have power periodic interruptions where I is direct, he bet to unplug the iMac and airport Time Capsule at the moment that I'm missing?

    As long as the computer is turned off, it is not really necessary to unplug. IF you live in one are frequent interruptions with electricity then I would say strongly to get a UPS to protect your devices.

  • Can I take some images from a video for a period of time?

    So, I was filming a time to build myself a bed flat pack.  Initially I started with a delay of 5 seconds on my go pro, but at halfway, I went for lunch and stopped the time.  On his return, I stupidly clicked on play and didn't go pro gave to the video recording mode.  So I have half my time elapsed as a photo, taken at intervals of 5 seconds, and the other half in 1080 p at 60 frames per second.  Is it possible that I can take a cap of a single image of the video screen every 5 seconds (or every 300 images or more) to make it so the same format as the first part.  I don't want to do this manually because this way, I would have about 50 minutes of video to sift through.

    See you soon.

    A viable method is to:

    1 apply a posterize time effect to the clip and set the framerate 1FPS

    2. use speed/duration (right click on the clip) and set a pace faster or the shorter duration - a few mathematical functions required: new duration = duration of the clip in seconds / 5 (since you wanted to 5 seconds interval) / frame rate of the project.  for example 50 min = 3000 s;  3000/5 = 600 (or images) / 30 fps = 20 seconds.  Think math is right.

    See you soon

  • Track the number of deployments over a period of time

    Hi all

    I need to track the number of deployments in Labmanager since 01/01/2009 up to this day, is there a way to generate this report LM or by running a query in the comic book? Also, if possible, I would like to know which are the most deployed commnly models and the number of times they have been deployed?

    I got in contact with support, but they do not have a soultion for this and asked me to open a FR., but any help to generate this report, is very popular.

    I use VMware, Inc.® Lab Manager 3.0 (3.0.0.2056)

    Kind regards

    Pattabhi Raman

    Maybe this thread can help you get started on your goal:

    http://communities.VMware.com/message/1389306/

    Kind regards

    EvilOne

    VMware vExpert 2009

    NOTE: If your question or problem has been resolved, please mark this thread as answered and awarded points accordingly.

  • No way of knowing where the tablespace used for a period of time

    Hi all

    I have a very generic question:

    We have a daily report for information storage space in our production approx. In a 30.97% of free space in a tablespace on 27/06/2009. 28/06/2009 it reported only a 1.53% free. I would like to know what segments of the entire space went during this period. I looked in the dba_extents but could not see at all times by related information, which tells me that when the extents allocated. Anyone can share this info with me?

    Thanks a lot for your help in advance!

    Shirley

    _DELTA usually indicates a change (i.e. the size has changed during the snapshot interval).

    Justin

  • Browser gets temporarily unstable after using it for a period of time, until reset

    I just installed Windows 8.1 to my computer, and I am currently using the latest version of Firefox. I noticed that after I used the browser for a while, when I'm watching a video stream, or scrolling / clicking through the pages, the browser hangs temporarily for a second.

    The thing that keeps the ground being restarts Firefox (with and without addons). As the browser becomes jerky, I tried other browsers like IE to see if it applies as well to that, and he behaves in a more fluid way.

    After awhile, it gets really annoying to have to reset the output and start the browser, each time that it starts to be shaken. Speculation as to what might bring him?

    Try disabling graphics hardware acceleration. As this feature has been added to Firefox, it has gradually improved, but there are still some problems.

    You will have to perhaps restart Firefox for it to take effect, so save any work first (e.g. you compose mail, documents online that you are editing, etc.).

    Then perform the following steps:

    1. Open the Firefox Options (Preferences on Mac or Linux) as follows:

      • In Firefox 29,0 and above, click on the menu button

        then select Options Preferences on Mac or Linux, or Windows.

      • In 28.0 Firefox and earlier versions, click on the Firefox orange upper-left button, then select the 'Options' button or, if there is no button up Firefox, go to tools > Options.
    2. In the window of Firefox Options (or preferences), click on the Advanced tab, and then select general.
    3. You will find in the list of parameters, the checkbox use hardware acceleration when available . Clear this check box.
    4. Now restart Firefox and see if the problems persist.

    In addition, please check the updates for your graphics driver by following the steps in the following knowledge base articles:

    This solve your problems? Please report to us!

    Thank you.

Maybe you are looking for