Any solution to LAST_VALUE with count (*) and BETWEEN the LINES without limit precedi

I'm working on the cover search active county from COV_CHG_EFF_DATE for the ID of strategy and Futures (sample data are for a single policy). The rule for the coverage of assets are counted as below
Transaction Type Count
01, 02                +1
06, 07                +1
09, 10                -1
03                       0

 
COVERAGE_NUMBER TRANSACTION_TYPE COV_CHG_EFF_DATE  Active_Cover_Count
01                              01                       22/OCT/2011                  2
02                              01                       22/OCT/2011                  2
04                              02                       23/OCT/2011                  3
05                              02                       28/OCT/2011                  4
05                              09                       30/OCT/2011                  2
02                              09                       30/OCT/2011                  2
05                              06                       03/NOV/2011                  3
05                              03                       03/NOV/2011                  3
05                              09                       05/NOV/2011                  0
01                              09                       05/NOV/2011                  0
04                              09                       05/NOV/2011                  0
I find LAST_VALUE limit with the help of count (distinct COVERAGE_NUMBER) and the LINES BETWEEN Unbounded preceding AND 1 previous characteristic. Is there another better logical or analytical function in support of the application to calculate the value of aggregation based set of rules? Data from table and sample before if anyone find solution. Thank you.
----------------------------------------------------------------------------------------------------------------------------------------
drop table PC_COVKEY_PD;

create table PC_COVKEY_PD (PC_COVKEY varchar(30),
POLICY_NUMBER varchar(30),
TERM_IDENT varchar(3),
COVERAGE_NUMBER varchar(3),
TRANSACTION_TYPE varchar(3),
COV_CHG_EFF_DATE date,
TIMESTAMP_ENTERED timestamp
);

delete from PC_COVKEY_PD;

commit;

insert into PC_COVKEY_PD values ('10695337P3021MC0020012', '10695337P3', '021', '002', '02', to_date('22/OCT/2011','DD/MM/YYYY'), cast('22/SEP/2011 03:10:12.523408 AM' as timestamp));
insert into PC_COVKEY_PD values ('10695337P3021MC0010012', '10695337P3', '021', '001', '02', to_date('22/OCT/2011','DD/MM/YYYY'), cast('22/SEP/2011 03:10:12.523508 AM' as timestamp));
insert into PC_COVKEY_PD values ('10695337P3021MC0040012', '10695337P3', '021', '004', '02', to_date('22/OCT/2011','DD/MM/YYYY'), cast('22/SEP/2011 03:10:12.864153 AM' as timestamp));
insert into PC_COVKEY_PD values ('10695337P3021MC0040032', '10695337P3', '021', '004', '03', to_date('22/OCT/2011','DD/MM/YYYY'), cast('22/SEP/2011 03:10:12.865153 AM' as timestamp));
insert into PC_COVKEY_PD values ('10695337P3021MC0050012', '10695337P3', '021', '005', '02', to_date('22/OCT/2011','DD/MM/YYYY'), cast('22/SEP/2011 03:10:12.976483 AM' as timestamp));
insert into PC_COVKEY_PD values ('10695337P3021MC0020042', '10695337P3', '021', '002', '09', to_date('22/NOV/2011','DD/MM/YYYY'), cast('16/FEB/2012 02:26:00.006435 PM' as timestamp));
insert into PC_COVKEY_PD values ('10695337P3021MC0040042', '10695337P3', '021', '004', '03', to_date('22/NOV/2011','DD/MM/YYYY'), cast('16/FEB/2012 02:26:00.135059 PM' as timestamp));
insert into PC_COVKEY_PD values ('10695337P3021MC0050042', '10695337P3', '021', '004', '09', to_date('22/NOV/2011','DD/MM/YYYY'), cast('16/FEB/2012 02:26:00.253340 PM' as timestamp));
insert into PC_COVKEY_PD values ('10695337P3021MC0020042', '10695337P3', '021', '004', '03', to_date('22/NOV/2011','DD/MM/YYYY'), cast('16/FEB/2012 02:26:00.363340 PM' as timestamp));
insert into PC_COVKEY_PD values ('10695337P3021MC0040032', '10695337P3', '021', '005', '09', to_date('29/NOV/2011','DD/MM/YYYY'), cast('16/FEB/2012 02:26:00.463340 PM' as timestamp));
insert into PC_COVKEY_PD values ('10695337P3021MC0050032', '10695337P3', '021', '005', '03', to_date('29/DEC/2011','DD/MM/YYYY'), cast('16/FEB/2012 02:26:00.563340 PM' as timestamp));
insert into PC_COVKEY_PD values ('10695337P3021MC0020012', '10695337P3', '021', '002', '03', to_date('30/DEC/2011','DD/MM/YYYY'), cast('16/FEB/2012 02:26:00.663340 PM' as timestamp));

commit;
Published by: 966820 on October 30, 2012 20:30

Tags: Database

Similar Questions

  • How do you multiline text in a continuous form between the lines without scaling of the text?

    Help. How do you multiline text in a continuous form between the lines without scaling of the text?

    I tried to put each line of the form for amounts of specificity so that it ends at some point and does not change the text size to fit on the line but different key characters have different widths, so you do not get a length of the same line.

    I tried to remove the long text scrolling, but it changed nothing.

    I can create a text box great to fill out and have this scrolling of additional lines, but then I get too much information from people and I would need to clarify the lines behind the answer multi line text, or delete the lines...

    Is there a better solution?

    I usually just remove the lines and set the field "Does not scroll long text" so that all the text is visible. Including the lines is really only useful if the form may be printed and completed by hand, in which case you can use scripts as in this example is: http://acroscript.net/pdf/demos/multiLine_Demo1.pdf

    It works as expected in Acrobat/Reader, but not in Chrome and other PDF viewers who have little or no support for JavaScript. It uses scripts customized to validate on Focus and blur.

  • problem with tabs and filter the lines of memory cache

    Dear all I have a problem with the oaf page has two tabs under two of them consists of a table and add the button to the row. Second tab, it's a detail of the first tab, which means that each line in the first tab may refer to one or more lines in the second tab, my problem is when I add the line in the first tab and go to the second tab to add lines to this line of the display of the page added all lines not only the matching lines.

    my code:

    1 - controller

    When press Tab of Lot lines (partial action)
    If (goLotsTab".equals (pageContext.getParameter (OAWebBeanConstants.EVENT_PARAM))) {" "}

    String trxLineId = "38";//row.getAttribute("TrxLineId").toString(); "
    AddLotParam serializable [] = {trxLineId};
    am.invokeMethod ("getTrxLot", addLotParam);
    }
    What press Add button lines of lots (partial action)
    If (addLot".equals (pageContext.getParameter (OAWebBeanConstants.EVENT_PARAM))) {" "}
    String trxLineId = "38"; row.getAttribute("TrxLineId").toString ();
    AddLotParam serializable [] = {trxLineId};
    am.invokeMethod ("addTrxLot", addLotParam);
    }

    When press Add a tab line (partial action)
    If (addLine".equals (pageContext.getParameter (OAWebBeanConstants.EVENT_PARAM))) {" "}
    am.invokeMethod ("addLine", params);
    }

    Methods 2 - am

    public void getTrxLot (String pTrxLineId)
    {
    OAViewObject vo = (OAViewObject) getXXSiteLotsVO1 ();
    LinVo OAViewObject = (OAViewObject) getXXSiteLineVO2 ();

    Line linRow = linVo.getFirstFilteredRow ("SelectLineFlag", "Y");
    pTrxLineId = linRow.getAttribute("TrxLineId").toString ();

    If (!) VO.isPreparedForExecution ())
    //{
    try {}
    String existringWhereClause = vo.getWhereClause ();
    vo.setWhereClauseParams (null);
    vo.setWhereClause("trx_line_id=:1");
    vo.setWhereClauseParam (0, (pTrxLineId) Number);
    vo.executeQuery ();
    vo.setWhereClauseParams (null);
    vo.setWhereClause (existringWhereClause);
    }
    catch (Exception exceptionl)
    {
    throw OAException.wrapperException (exceptionl);
    }

    // }
    following line is commented, but I think that it will contribute to the memory of the filter
    cached data to be mapped.

    Rank [] lotRows = vo.getFilteredRows ("TrxLineId1", pTrxLineId);
    }

    /////////////////////////////////////////////////////////////////
    public void addTrxLot (String pTrxLineId)
    {
    OAViewObject vo = (OAViewObject) getXXSiteLotsVO1 ();
    LinVo OAViewObject = (OAViewObject) getXXSiteLineVO2 ();

    Line linRow = linVo.getFirstFilteredRow ("SelectLineFlag", "Y");
    pTrxLineId = linRow.getAttribute("TrxLineId").toString ();

    If (vo.getFetchedRowCount () == 0) {}
    vo.setMaxFetchSize (0);
    // }

    VO. Last();
    VO. Next();
    Line = vo.createRow ();
    row.setAttribute ("TrxLineId", pTrxLineId);
    vo.insertRow (row);
    row.setNewRowState (Row.STATUS_INITIALIZED);
    }

    OK, I'll share my latest code using other

    public void createTransaction() {}

    OAViewObjectImpl vo = getXXSiteHeaderVO1();

    If (! vo.isPreparedForExecution ()) {}

    vo.executeQuery ();

    }

    If (vo.getFetchedRowCount () == 0)

    {

    vo.setMaxFetchSize (0);

    }

    String status = "incomplete."

    OADBTransaction txn = (OADBTransaction) getOADBTransaction ();

    • oracle.jbo.domain.Date currentDate = txn.getCurrentUserDate ();

    Line = vo.createRow ();

    row.setAttribute ("TrxStatus", status);

    1. row.setAttribute ("TrxDate", currentDate);

    vo.insertRow (row);

    row.setNewRowState (Row.STATUS_INITIALIZED);

    }

    {} public void addLine (String pTrxHeeaderId)

    OAViewObject vo = (OAViewObject) this.getXXSiteTrxVL1 () .getDestination ();

    VO. Last();

    VO. Next();

    Line = vo.createRow ();

    int linNum = vo.getFetchedRowCount () + 1;

    row.setAttribute ("TrxHeaderId", pTrxHeeaderId);

    row.setAttribute ("LineNum", String.valueOf (linNum));

    row.setAttribute ("SelectLineFlag", "Y");

    vo.insertRow (row);

    row.setNewRowState (Row.STATUS_INITIALIZED);

    }

    Public Sub getTrxLot()

    {

    LinVo OAViewObject = (OAViewObject) this.getXXSiteTrxVL1 () .getDestination ();

    Line linRow = linVo.getFirstFilteredRow ("SelectLineFlag", "Y");

    String pTrxLineId = linRow.getAttribute("TrxLineId").toString ();

    linVo.setCurrentRow (linRow);

    OAViewObject vo = (OAViewObject) this.getXXSiteLineLotsVL1 () .getDestination ();

    }

    Public Sub addTrxLot()

    {

    LinVo OAViewObject = (OAViewObject) this.getXXSiteTrxVL1 () .getDestination ();

    Line linRow = linVo.getFirstFilteredRow ("SelectLineFlag", "Y");

    String pTrxLineId = linRow.getAttribute("TrxLineId").toString ();

    linVo.setCurrentRow (linRow);

    OAViewObject vo = (OAViewObject) this.getXXSiteLineLotsVL1 () .getDestination ();

    VO. Last();

    VO. Next();

    Line = vo.createRow ();

    row.setAttribute ("TrxLineId", pTrxLineId);

    row.setAttribute ("RowKey", new oracle.jbo.domain.Number (1));

    vo.insertRow (row);

    row.setNewRowState (Row.STATUS_INITIALIZED);

    }

  • Low contrast between the lines of measurement and background

    There is little contrast between the lines of action (dark gray) and (dark gray) background in the arrange window. Did someone come with a 'fix' yet for this?

    I speak now of LPX.

    Thank you!

    Have you tried to check this box...

  • When I select this option I get the dialog box 'Create image s system' but it cannot find any 'backup devices on this computer"and lists the error 0 x 81000036

    Error image system original title: windows 7 0 x 81000036

    I'm doing a backup system image.  When I select this option I get the dialog box 'Create image s system' but it cannot find any 'backup devices on this computer"and lists the error 0 x 81000036.

    I have an ESATA connection on my Dell laptop I was trying to make the image on.  I use the unit every day to save files and which works very well.  He just leaves me CCADE with the system image backup...

    any ideas?

    Hello

    ·         You have created a system image backup before that?

    ·         You did it changes on your computer?

    ·         Is your esata formatted NTFS drive?

    Try to save the image of the boot system: http://support.microsoft.com/kb/929135

    Note: make sure that you start the computer in normal mode after a repair.

    See also the linkfor more information about the backup: http://windows.microsoft.com/en-US/windows7/Back-up-your-programs-system-settings-and-files

  • I have a laptop with Windows XP. After getting a virus, I scanned with AVG and removed the threat. After re-booting, I can not connect to wireless internet.

    I have a laptop with Windows XP.  After getting a virus, I scanned with AVG and removed the threat.  After re-booting, I can not connect to wireless internet.  The icon shows "acquiring network address".  I connected the router directly on laptop computer connected to the wireless network and still unable to connect.  I tried to restore the system as well, but the message says "unable to restore the system, no changes were made.  Help?

    original title: acquisition of network address

    Hello, Steve.

    Try this link below on how to reset IE and let me know if it helps.
  • Cannot select the Panel of configuraiton of 'Security' with Down and Up the keys on the keyboard

    After you install BlackBerry10Simulator-Installer-BB10_0_06-384-Win-201207130120.exe on Windows XP (Vmware player 3.1.3), I can't select the Panel of configuraiton of 'Security' with Down and Up the keys on the keyboard, because "Screen" is the last item on the screen.

    It works with a mouse. Thank you.

    I use a computer thinkpad notebook and always use the navigation button (red button), so I now have to use a mouse.

  • I've updated the plan of the photographer and since the download, I had problems nonstop with fluidity and now the bridge is not displayed large previews, a few thumbnails. I restarted and reset the tool, is there anything else I can do or should I cancel

    I've updated the plan of the photographer and since the download, I had problems with non stop with fluidity and now the bridge is not displayed large previews, a few thumbnails. I restarted and reset the tool, is there anything else I can do or do I cancel my subscription to the CC and return to the CS6?

    The problem of fluidity can be the result of a graphics card problem:

    Try to uncheck the box in the preferences > performance > graphics processor use, then by restarting Photoshop. If this solves the problem, check with the manufacturer about a possible update.

    On the bridge: when you select an image and press the space bar, what happens?

  • How to create a table with spaces between the lines...

    Hello

    I use jdev 11.1.1.6 and I need to insert spaces between the lines. How this can be done?

    Thank you and best regards,
    Tarun Agrawal

    Hello

    I'm sorry to forget on the spacer. You must use css like mentioned AP.

    Arun-

  • How can I close a space between the lines?

    I typed a promissory note and have extra space between the lines.  How can I close this space?

    Hello

    Click on the "Line spacing" icon in the section 'Paragraph' of the 'Home' tab This icon is the fourth first in the default icon and has a high and arrow down to it.

    Click your setting spacing appropriate line in the list that appears.

    Change the default font size

    http://www.askdavetaylor.com/change_default_font_size_in_wordpad.html

    Windows XP Professional must have a copy of the Works word processor.  It is easier to work with.

    Start > type Works

    Select the word processor from the list

    If it does not, go to C:\\Program Microsoft Works

    Search for MSWorks

    Double-click the file to launch

    The icon looks like this in Windows Vista-

  • angles between the lines

    I am trying to find a way to understand the angle between the lines. These lines will always intersect. For example, if a line has xy of 100.0 and 100 200 values and the other line has a value of 0.50 xy and 200.50. These two lines when Wescott on a graph are 90 degrees to each other. I can just find a way to do this. Any ideas?

    Here's a way to do it. You can also use the mathematical functions to make it as Lynn suggested.

    Ben

  • PC can see and access the laptop without asking for a user name and password but the laptop cannot access the PC because it asks me a username and password that I don't know.

    Vista - Windows 7 network connection. username and password is unknown.

    Hello

    I just got a laptop with windows 7 on it and I want to connect to my other PC for it, they are on the same network through a router. the PC can see and access the laptop without asking for a user name and password but the laptop cannot access the PC because it asks me a username and password that I don't know.

    If someone could answer this question, it would be great.

    Hello
    Maybe this can help.

    Win7 when configured on the peer-to-peer network has three types of configurations of sharing.

    Group residential network = only works between Win 7 computers. This type of configuration, it is very easy to entry level users to start sharing network.

    Working network = fundamentally similar to previous methods of sharing that allow you to control what, how and to whom the records would be shared with.

    Public share
    = network Public (as Internet Café) in order to reduce security risks.

    For the best newspaper of the results of each computer screen system and together all computers on a network of the same name, while each computer has its own unique name.

    http://www.ezlan.NET/Win7/net_name.jpg

    Make sure that the software firewall on each computer allows free local traffic. If you use 3rd party Firewall on, Vista/XP Firewall Native should be disabled, and the active firewall has adjusted to your network numbers IP on what is sometimes called the Zone of confidence (see part 3 firewall instructions

    General example, http://www.ezlan.net/faq.html#trusted
    Please note that some 3rd party software firewall continue to block the same aspects it traffic Local, they are turned Off (disabled). If possible, configure the firewall correctly or completely uninstall to allow a clean flow of local network traffic. If the 3rd party software is uninstalled, or disables, make sure Windows native firewall is active .

    ------------------------------

    If your network consists only of Win 7 and you want a simple network, use it.

    http://Windows.Microsoft.com/en-us/Windows7/help/videos/sharing-files-with-HomeGroup

    After you have configured the homegroup, scroll to the bottom for the Permission/security section.

    -----------------------------

    Win 7 networking with other version of Windows as a work network.

    In the center of the network, by clicking on the type of network opens the window to the right.

    Choose your network type. Note the check box at the bottom and check/uncheck depending on your needs.

    http://www.ezlan.NET/Win7/net_type.jpg

    Win 7 - http://windows.microsoft.com/en-us/windows7/Networking-home-computers-running-different-versions-of-Windows

    Win 7 network sharing folder specific work - http://www.onecomputerguy.com/windows7/windows7_sharing.htm

    Vista file and printer sharing - http://technet.microsoft.com/en-us/library/bb727037.aspx

    Windows XP file sharing - http://support.microsoft.com/default.aspx?scid=kb;en-us;304040
    Sharing printer XP - http://www.microsoft.com/windowsxp/using/networking/expert/honeycutt_july2.mspx

    Setting Windows native firewall for sharing XP - http://support.microsoft.com/kb/875357
    Windows XP Patch for sharing with Vista (no need for XP - SP3) - http://support.microsoft.com/kb/922120

    When you have finished the configuration of the system, it is recommended to restart everything the router and all computers involved.

    -------------

    If you have authorization and security problems, check the following settings.

    Point to a folder that wants to share do right click and choose Properties.

    In the properties

    Click on the Security tab shown in the bellows of the photo on the right) and verify that users and their permissions (see photo below Centre and left) are configured correctly. Then do the same for the authorization tab.

    This screen shot is to Win 7, Vista menus are similar.

    http://www.ezlan.NET/Win7/permission-security.jpg

    The Security Panel and the authorization Panel, you need to highlight each user/group and consider that the authorization controls are verified correctly.

    When everything is OK, restart the network (router and computer).

    * Note . The groups and users listed in the screen-shoot are just an example. Your list will focus on how your system is configured.

    * Note . There must be specific users. All means all users who already have an account now as users. This does not mean everyone who feel they would like to connect.

    ---------------------

    *** Note. Some of the processes described above are made sake not for Windows, but to compensate for different routers and how their firmware works and stores information about computers that are networked.

    Jack-MVP Windows Networking. WWW.EZLAN.NET

  • Code view in Dreamweaver displays large empty spaces between the lines

    See attached image. Code view shows large differences between the lines. It is not an extra space. I can't remove it. As you can see in the picture if I select the code space is attached to the code. I'm sure that it is a very simple display option change, but I've looked everywhere. I've just upgraded to the latest version of the thought of DW which may help, but he always does. How can I get rid of the extra space?

    Screen Shot 2015-12-11 at 9.29.42 AM.png

    With highlighting the way in which it is, it seems to me that you may have a corrupt police.

    Go in Edition > Preferences > fonts > mode Code and switch to Source Code Pro (if this isn't the case) or something like courier so it is.

    If it is a corrupt police, the origin of the problem, which should dissipate it.

  • It is Possible to reduce the space between the lines after < CR > a text block?

    Hello

    I paste text without ANY special models in my custom CSS layout.

    I would have less space between the line after a < CR >.

    see you soon,

    Dreamer101.1

    Using the following style rules

    p, {br}
    margin: 0;
    padding: 0;
    }

    and look at the result.

    I hope this helps

    Ben

  • I want to buy a desktop computer and sell the laptop without windows vista software. Is there a way I can install windows vista in my new office.

    Model F730 laptop and notebook product S/n CNF7415WH7

    I bought a laptop (compaq F30 us in the United States) and windows original vista came with the compaq laptop (bought in US). Now, I want to buy a desktop computer and sell the laptop without windows vista software. Is there a way I can install windows vista in my new office. I don't have the cd or the software with me key since they have not provided for me at the time of purchase

    Hello

    No there is no way, how the do, because the license of Windows Vista is part of the computer compaq laptop - this is the license OEM - and cannot be separated.

    (in case the laptop is broken and cannot be repaired, then the license expiresand cannot be used on another computer)

    LC

Maybe you are looking for