Why the different values for an analytic function of the same group/game

I have the suite of table I'll be using.

Select * from table1;

REC_ID | STATUS | DATE_FROM | DATE_TO

1. C | 7 January 2015 |

2. H | December 3, 2014. 6 January 2015

3. H | October 3, 2014. December 2, 2014

4. H | May 30, 2014. October 2, 2014

5. H | May 29, 2014 | May 29, 2014

6. H | April 16, 2014 | May 28, 2014

7. H | Tuesday, April 25, 2007 April 15, 2014

INSERT statement if you need.

TOGETHER TO DEFINE

CREATE THE TABLE1 TABLE:

(

NUMBER OF REC_ID,

VARCHAR2 (1 BYTE) STATUS NOT NULL,.

DATE_FROM DATE NOT NULL,

DATE OF DATE_TO

);

Insert into TABLE1

(REC_ID, STATUS, DATE_FROM)

Values

(1, 'C', TO_DATE (7 JANUARY 2015 00:00:00 ',' DD/MM/YYYY HH24:MI:SS'));))

Insert into TABLE1

(REC_ID, STATUS, DATE_FROM, DATE_TO)

Values

(2, 'H', TO_DATE (3 DECEMBER 2014 00:00:00 ',' DD/MM/YYYY HH24:MI:SS'), TO_DATE (6 JANUARY 2015 00:00:00 ',' DD/MM/YYYY HH24:MI:SS'));))

Insert into TABLE1

(REC_ID, STATUS, DATE_FROM, DATE_TO)

Values

(3, 'H', TO_DATE (3 OCTOBER 2014 00:00:00 ',' DD/MM/YYYY HH24:MI:SS'), TO_DATE (2 DECEMBER 2014 00:00:00 ',' DD/MM/YYYY HH24:MI:SS'));))

Insert into TABLE1

(REC_ID, STATUS, DATE_FROM, DATE_TO)

Values

(4, 'H', TO_DATE (MAY 30, 2014 00:00:00 ',' DD/MM/YYYY HH24:MI:SS'), TO_DATE (2 OCTOBER 2014 00:00:00 ',' DD/MM/YYYY HH24:MI:SS'));))

Insert into TABLE1

(REC_ID, STATUS, DATE_FROM, DATE_TO)

Values

(5, 'H', TO_DATE (29 MAY 2014 00:00:00 ',' DD/MM/YYYY HH24:MI:SS'), TO_DATE (29 MAY 2014 00:00:00 ',' DD/MM/YYYY HH24:MI:SS'));))

Insert into TABLE1

(REC_ID, STATUS, DATE_FROM, DATE_TO)

Values

(6, 'H', TO_DATE (APRIL 16, 2014 00:00:00 ',' DD/MM/YYYY HH24:MI:SS'), TO_DATE (28 MAY 2014 00:00:00 ',' DD/MM/YYYY HH24:MI:SS'));))

Insert into TABLE1

(REC_ID, STATUS, DATE_FROM, DATE_TO)

Values

(7, 'H', TO_DATE (APRIL 25, 2007 00:00:00 ',' DD/MM/YYYY HH24:MI:SS'), TO_DATE (APRIL 15, 2014 00:00:00 ',' DD/MM/YYYY HH24:MI:SS'));))

COMMIT;

I will exercise more analytical query...

Select rec_id date_from, date_to, status,

min (date_from) over (partition by order of status by date_from desc) min_dt_from_grp,

ROW_NUMBER() over (partition by order of status by date_from desc) rownumberdesc,

ROW_NUMBER() over (partition by order of status by ASC date_from) rownumberasc

FROM table1;

the query result

REC_ID | DATE_FROM | DATE_TO | STATUS | MIN_DT_FROM_GRP | ROWNUMBERDESC | ROWNUMBERASC

1. 7 January 2015 | C | 7 January 2015 | 1. 1

2. December 3, 2014. 6 January 2015 | H | December 3, 2014. 1. 6

3. October 3, 2014. December 2, 2014 | H | October 3, 2014. 2. 5

4. May 30, 2014. October 2, 2014 | H | May 30, 2014. 3. 4

5. May 29, 2014 | May 29, 2014 | H | May 29, 2014 | 4. 3

6. April 16, 2014 | May 28, 2014. H | April 16, 2014 | 5. 2

7. Tuesday, April 25, 2007 April 15, 2014. H | Tuesday, April 25, 2007 6. 1

If you look at the output above, it dates back in the min_dt_from_grp column.

MY question is if the analytical function calculates for a particular/set group, which is by statute and for what min (date_from) partition is 25-apr-2007 for the GROUP H (Status column), then why I have different values returned by the query above in the min_dt_from_grp column.

Hello

Because you have specified an ORDER BY clause for the analytical function. In doing so, you calculate the rows on a window. Since you have not specified a windowing clause, the default applies:

RANGE BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW

Tags: Database

Similar Questions

  • different values on the same grouping column

    Hi all

    I have a requirement to find different recordings of the same grouping columns have value different values in the columns, for example:

    WITH

    Data (G1, COL)

    AS

    (

    SELECT 'A', '456' FROM dual UNION ALL

    SELECT 'A', '345' FROM dual UNION ALL

    SELECT 'A', ' ' FROM dual UNION ALL

    SELECT ' 'B, 123' FROM dual UNION ALL.

    SELECT ' 'B, 123' FROM dual UNION ALL.

    SELECT ' 'B, 123' FROM dual UNION ALL.

    SELECT 'C', "789' FROM dual UNION ALL

    SELECT 'C', "789' FROM dual UNION ALL

    SELECT 'C', "" the DOUBLE

    )

    Select g1, pass data

    Ideally for G1 = A, the NECK should have that a single value across records ' 456 'or ' 345'. So I need to check the values in NOT NULL of the COL where, for any value of G1, we have different values of the colonel G1 = 'B' is perfectly fine, so I don't need. G1 = C is good too and I'm not worried about it. I only need these entries when the neck was non-empty value / NULL not different for the same value of G1.

    So expected out put is

    Capture.PNG

    WITH

    Data (G1, COL)

    AS

    (

    SELECT 'A', '456' FROM dual UNION ALL

    SELECT 'A', '345' FROM dual UNION ALL

    SELECT 'A', "double UNION ALL

    SELECT ' 'B, 123' FROM dual UNION ALL.

    SELECT ' 'B, 123' FROM dual UNION ALL.

    SELECT ' 'B, 123' FROM dual UNION ALL.

    SELECT 'C', "789' FROM dual UNION ALL

    SELECT 'C', "789' FROM dual UNION ALL

    SELECT 'C', "the DOUBLE

    )

    Select g1,

    Col

    de)

    Select g1,

    Col,

    Count (distinct trim (col)) at the NTC (g1 partition)

    from the data

    )

    where NTC! = 1

    and trim (col) is not null

    /

    G COL. NO.
    - ---
    A 345
    A 456

    SQL >

    SY.

  • I currently have a creative cloud with an e-mail account, however I have a behance with an e-mail account that I have had for many years (even Adobe and Behance made before part of the same group). Can I combine these two accounts into one?

    I currently have a creative cloud with an e-mail account, however I have a behance with an e-mail account that I have had for many years (even Adobe and Behance made before part of the same group). Can I combine these two accounts into one? I want to use the account that I pay cloud Creative if I can use the new portfolio feature.

    Thank you.

    This is an open forum, not Adobe support... below to connect with Adobe personnel to help

    While the forums are open 24/7 you can't contact Adobe support at any time

    Chat support: Mon - Fri 05:00-19:00 (US Pacific Time)<=== note="" days="" and="">

    Don't forget to stay signed with your Adobe ID before accessing the link below

    Creative cloud support (all creative cloud customer service problems)

    http://helpx.Adobe.com/x-productkb/global/service-CCM.html

  • split the data belonging to the same group at two different levels

    Hello

    I have data in the same group I want to split into two levels.

    For example: If the XML is:

    < data >
    Taxable < Type > < / type >
    < value1 > one < / value1 >
    b < value2 > < / value2 >
    < / data >
    < data >
    Taxable < Type > < / type >
    e < value1 > < / 1 >
    f < value2 > < / value2 >
    < / data >
    < data >
    Taxable < Type > < / type >
    g < value1 > < / 1 >
    h < value2 > < / value2 >
    < / data >
    < data >
    Taxable < Type > < / type >
    u < value1 > < / 1 >
    v < value2 > < / value2 >
    < / data >
    < data >
    Taxable < Type > < / type >
    o < value1 > < / 1 >
    < value2 > x < / value2 >
    < / data >


    The output using the RTF model should be:

    Taxable
    a and b
    e f
    g h

    Not taxable
    u v
    l x

    I can't change the query to add a group.

    Kindly, if anyone can help

    Published by: user10606061 on 25/06/2012 01:05


    delete a table with 2 columns and two rows. In the second column of row 1

    in column 2

    table below

    PS: your must be within a root element

  • Radio buttons in different objects is part of the same group?

    Hi all

    I have a component custom with a radio button and enter text in there. I'm dynamically adding instances of these components in a VGroup, however, I have difficulties to do belong to the same group of radio button.  I tried to adjust their property groupName under the same name, but they always behave as separate radio buttons (you can select all of them and they will be selected).  Does anyone have any ideas on how I can do belong to the same radio button group? Any help will be greatly appreciated. Thank you.

    Create a RadioButtonGroup in the main application, and set the Group on the

    Radio buttons in the group.

  • Can roads be part of the same group, but there are other paths inserted between them?

    CS4 on Mac. I would like to know something about the relationship between the Group and the organization. For example, these three boxes:

    Screen Shot 2015-01-03 at 1.33.57 PM.png

    Is it possible to make the part two blue boxes of the same group, but while maintaining this order? If I try the command to base group, the big box in the background moves above the yellow area.

    Mary,

    You cannot use a group for it, but you can use a selection: select the objects (the two blue boxes or whatever, even through layers), then select > Save selection and give it a name. Then, you can select the selection at the bottom of the Select drop-down list (you can have several other different).

  • REP-1248, all sources of placeholder columns must be in the same group

    Hi all

    I'm developing a (10g) report that contains three executives of repetition, say R1, R2, R3. Independent of each other, not connected or linked.
    I have a column defined in each summary of groups, G1, G2, G3, associated with R1, R2, and R3 to count the number of records in each group say. If the three groups count is 0, there is an another framework, I have defined, M1, containing the text as "No record found" that should be displayed.
    I can not access the summary columns defined in the format of M1 trigger groups because it is separated from R1, R2, and R3. So I created a column placeholder CP1, which recognizes the M1.
    But I'm not able to set the value of CP1 to the sum of analytical columns CS1, CS2, CS3 in the formula trigger of the CP1.
    I get the error:
    REP-1248 all sources of placeholder columns must be in the same group

    I also tried to set the value of the CP1 in CS1, CS2, and CS3 formula columns to get the same error.

    Is it possible to be able to use the analytical columns within the groups to have the feature above?

    Thank you
    Shruti

    create a place holder cp_1 in the external data model of all queries

    in each query, create a numerical formula
    with this code

    Start
    : cp_1: = nvl(:cp_1,0) + 1;
    Return 1;
    end;

    the nvl if she is not so necessary to the placeholder sets the initial value of zero

    then in the text frame properties go to conditional formatting
    Then create a new exception format

    cp_1 top to hide 0
    and then the work.

  • Can PS5000 and PS6210 - be in the same group?

    Hi all

    I have 2 PS6210 Equallogic units in a group, it is possible to add one of my old PS5000 devices to the group or do I need to keep them in separate groups?

    Thank you very much

    Eric

    Yes, you can... but:

    -The FW 7.x is the last for PS5000 and all members of a group must run the same version. So if you already upgraded your 6210 to 8.x you cannot add the PS5000

    -There is a guide of best practices on mix 1 and 10 GbE

    -As long as your PS5000 have a valid support contract youre allowed to download and deploy the latest FW version... think.  Members with and without the support of the same group is not allowed and will be trouble.

    I suggest to run the PS5000 on his own band.

    Kind regards

    Joerg

  • Former running and the new table in the same group?

    We have a ps4000 (sata, 16x1tb), which is short for maintenance in may without possibility of renewal.

    The ps4000 is a target for the replication of windows/hyper-v a ps6100x volumes and runs some volumes of hyper-v with virtual developer/test machines.

    We bought a new ps4210x to replace the old. Must be run on 1gbit for at least the next year.

    The best way to move data is to update the firmware on the ps4000 to even x 4210 a and then join the x 4210 to the ps4000 group?

    Is there a checklist of exactly what to do to move the data from one to the other?

    We do not know what to do with the old system. We think to buy one or two replacement disks ahead of time and use it for some time yet. Use it as a replication target and some virtual machines hosting not important.

    Suggest two systems running in the same group?

    Should we use two pools for the placement of volume or just leave the firmware balance data? Both systems have raid6.

    What is supported, if we run the two systems in the same group? We always have software support for the whole group or Dell would say a member has no more support, and we cannot help you at all?

    If I understand the firmware release notes, the 7.x will be the last major version for ps5xxx. Our 2010 ps4000 will have more time with the firmware updates?

    Hello

    You can not have supported and no load/EOL paintings in the same group.   Or you want to use it for replication.  Because if you had a problem, support is limited in what they can do with this HW unsupported.

    Re: migration of the PS4000.  I suggest that you create a new pool put the 4210 in this pool.  Create the RAIDset and ensure that both interfaces are active.   Then move the PS4210 to the same pool as the PS4000.   This will cause space to be redistributed into the new array.     If you want to minimize any impact of performance possible, wait until the space is rebalanced.   Then move the PS4000 to the temp pool.   This will leave all the data on the PS4210.   Once it is in the temporary pool, you can use the option "Delete" to delete the group.

    There will be future updates to the PS4000.

    Kind regards

  • How do subtract you different values for items in a specific table?

    Hi LabVIEW community.

    I am new to LabVIEW and Im working on my first application. One of my challenges I have problems is to know how to avoid specific values of some elements in a table.

    My application is to measure the distance between sensor and magnet, however the initial distance for each magnet sensor is different. I have converted the tension up to a distance using the Math node for each element and now need to correct these values by subtracting their initial value.

    The source is a table 1 d of DBL64 composed of 32 elements and each of these values must have a different value subtracted.

    for example:

    Element 1 - 5.557

    element 2 - 2.34

    3-7 654 element and so on

    I tried to separate them (index table) and subtract the values of each item and then combine them again. This was not effetive. I need to write these values in a .txt file and also to use them in another calculation.

    I have attached my attempted under VI.

    Any advice would really be apprecieated.

    You don't need to look it. There is a very simple method. Generate a table that contains all your desired offsets.  Then he subtract off the coast.

    This is the VI even with this change:

  • Set different values for an attribute inferred in all inferred entities

    Hey,.

    I have a rules database that infers the existence of a group of entities - no problem there. Now I add two alleged additional attributes that will exist for each instance of entity inferred, only I can't get this attribute to contain different values, based on rules.

    Basically, what I have is:

    the required policy

    "The policy 1.

    strategy 1 is required

    "The policy 2.

    strategy 2 is necessary

    the price of the required policy

    "500".

    policy 1

    "200".

    policy 2

    '100 '.

    in the opposite case

    the duration of the required font

    "1 year".

    policy 1

    "2 years".

    policy 2

    'Six months '.

    in the opposite case

    the price = InstanceValueIf (the required policy, the price of the necessary policy, true)

    duration = InstanceValueIf (the required policy, the duration of the required font, true)

    political is 1 if

    Know WHAT to DO HERE

    policy 2 is so

    I DON'T KNOW WHAT TO DO HERE



  • Why the same photo's file size different in Photos and in the Finder?

    I have a photo size 4608 x 3456. When I open the file information in the Apple's Photos app, it says that the file is 7.8 MB. When I open the same photo in the Finder and look at the news file, it is said that it is 3.1 MB on the disk. Why does this happen? All other metadata is the same in the pictures, Finder, Lightroom or Photoshop, but I can't understand why the file size seems to have changed since I dragged photo pictures to the Finder.

    Thank you.

    How you view the photo in the finder (you shouldn't be messing around inside the photo library)?

    If you export or drag / drop you create a new file with a different compression - using export allows you to control what

    LN

  • Why the same numbers are used every day for 4 updates

    Whenever I have shut down my computer, I get a message saying that 4 updates are being installed.  I checked my updates and they are the same 4 updates every day.  What gives?

    Here are a few ideas:

    Audit of the newspaper is not a bad idea. but it is likely that the update log has been accumulated since XP was installed, is probably quite large, overwhelming and intimidating to see.

    I can assure you about that nobody wants to watch a huge log file with a bunch of junk in it.

    You might stop the Automatic Update Service, rename or delete the log and restart the Service to get a new connection, but even when there is 'nothing to do', the journal is full of junk that is difficult to interpret.

    Since updates .NET Framework are connected and these updates are well known for installation problems, an option is to clear the log, just choose an update - say KB982168 and try to install it manually and then you can watch what is happening, and if you have disabled your front update log file It can be easier to spot the problem.

    There is little help that particular article KB, but sometimes the .net Framework updates are particularly bothersome - perhaps other previously botched updates, malware, or other reasons.

    The best thing to do when fail it these sorts of updates of .NET Framework (minimizing the frustration) is often just uninstall all the stuff of the .NET Framework and install everything again from scratch (after checking that there is no malicious software on the system).

    We know absolutely zero about this system because the MS Answers forums does not prompt for any information system when a new question is asked.  Well, we actually know a little bit of things - it's a computer.  Do not know information difficult troubleshooting.

    Hear me, people of MS Answers?

    If you check the links in the article of Microsoft KB for some other updates, like KB979909, you can read that Microsoft has free help and support for these and all security updates - and sometimes, they are actually quite helpful and responsive.

    There are several support options, including a toll free number for especially by using the security updates that fail to install.

  • I am trying to open a simple HTML5 document containing MP4 video without result. Why the same document open in, for example, Chrome?

    Small sample code (with delimiters modified to avoid the parking) which opens in Chrome but not im FF5.0:

    <!DOCTYPE html>
    <html lang="en">
    <head><meta charset="UTF-8"><title></title></head>
    <body>
    <video controls src="videofile.mp4">
    </video>
    </body>
    </html>

    The above code file and the video file mp4 are in the same folder.

    Firefox does not support MP4 via the video tag.

  • Why the same PDF allows to comment on Windows but not on Linux?

    All,

    I have a PDF document that (on version 9.5.1 Adobe Reader on Linux) has its file > properties... > Security > field commenting on the value "unauthorized."  However, I copied the same file on a Windows and Adobe Reader 10.1.3 machine to open.  On the Windows machine, the property of security even said this annotation is authorized.  Why the difference?  I would like to make comments on the Linux version, but it won't give me the tools to highlight or sticky notes.

    For what it's worth, all security properties (for example, 'Impression', 'Assembly of Document', '"content copying", etc.)  between the two copies of the PDF are identical.with with the exception of the property of 'comments '.

    Thanks for any help,

    -Steve Ross

    Thank you for your detailed review. In my opinion, your table supports my statement, and all is well. I stated (by the Readme) Reader X has been extended to allow the highlighting and sticky notes EVEN when a file is not extended.

    Thus, the Linux player, in version 9 and older than this change, should not for a default file display these tools. Since it cannot display these tools and no one else, poster correctly it is CORRECT to say his comments is not allowed.

    It seems to me that your table correctly records the difference between version 9 of the reader (Linux or Windows) and version X of the reader (not available for testing on Linux), except that nothing is wrong.

    It may not be what we want, but it's a whole different story.

Maybe you are looking for