Windows Function

Hi All,
I have the following query to get the latest record.
SELECT DISTINCT t1.amendment_id, t2.amend_status_code,
                RANK () OVER (PARTITION BY t1.amendment_id ORDER BY t2.entry_date DESC)
                                                                         RANK,
                t2.entry_date
           FROM amendment t1, amendment_status_history t2
          WHERE t1.amendment_id = t2.amendment_id
       GROUP BY t1.amendment_id, t2.amend_status_code, t2.entry_dateBut when i add in a condition after the WHERE statement " AND RANK () OVER (PARTITION BY t1.amendment_id ORDER BY t2.entry_date DESC)=1" I'm getting the "windows function is not allowed here" message. How can i solve this ? how can i get the records where the rank field has a value of '1'?
Thanks

Somethink like this
select * from (SELECT DISTINCT t1.amendment_id, t2.amend_status_code,
                RANK () OVER (PARTITION BY t1.amendment_id ORDER BY t2.entry_date DESC)
                                                                         RANK,
                t2.entry_date
           FROM amendment t1, amendment_status_history t2
          WHERE t1.amendment_id = t2.amendment_id
       GROUP BY t1.amendment_id, t2.amend_status_code, t2.entry_date) where rank = 1

Similar Messages

  • "Open in New Window" function in the page toolbar

    Hi,
    I am new to portal development and I have what looks like as an easy Iview modification:
    I need to implement the "open in new window" Function as a link, directly in the page toolbar (next to History, Back, Forward...) and not as an Option in the menu.
    This should be done in the Pagetoolbar and not the light pageToolbar.
    I downloaded the PAR file "com.sap.portal.navigation.pagetoolbar" but I don't how what I should change.
    Can someone please help me?
    Many thanks and points in advance.
    Regards

    Hi Stephane,
    Are you using the default framework page in your desktop. <b>Use the light framework page. It has the "Open in new window" as a link in the page tool bar.</b>
    If you still wish to stick to the default framework page; firstly you may want to remove the existing "open in new window" from the menu. Then you may need to copy the same code from the light fw toolbar par file for that 1 single link and paste it in your default fw toolbar. I can tell you the exact code tomorrow.
    Hope the first option may be desirable to you.

  • Feature not enabled: OLAP Window Functions

    I was trying to use the RANK function in oracle 8i when I got this message
    ORA-00439: feature not enabled: OLAP Window Functions
    Where do I enable this feature? there isn't enough detail available for this in documentation.
    Any help will be appriciated.

    That's correct
    The differences between Standard and Enterprise Edition are listed here:
    http://www.oracle.com/technology/products/oracle8i/pdf/8i_fam.pdf

  • Excel xls loses window functions, create new xlxs workbook problem solved

    Yosemite, has a bug with  the old Excel files xls.  Loses window function, can't shrink window.  Lower right corner disappears.  Solution is to copy your data and create a new xlxs file and the function returns.

    Hi Allan_L,
    Please try the methods that provided above. And this is the forum to discuss questions and feedback for Microsoft Excel, your issue is related to Excel DEV, if you have further question, I recommend you post the question to the MSDN forum for Excel
    http://social.msdn.microsoft.com/Forums/en-US/home?forum=exceldev&filter=alltypes&sort=lastpostdesc
    The reason why we recommend posting appropriately is you will get the most qualified pool of respondents, and other partners who read the forums regularly can either share their knowledge or learn from your interaction with us. Thank you for your understanding.
    George Zhao
    TechNet Community Support
    It's recommended to download and install
    Configuration Analyzer Tool (OffCAT), which is developed by Microsoft Support teams. Once the tool is installed, you can run it at any time to scan for hundreds of known issues in Office
    programs.

  • Windowing function in BMM

    Hi,
    How can I perform the following windowing function in BMM?
    count(distinct EVENT_ID BY CLIENT_KEY)
    Thanks.
    Andy

    Hi,
    I was able to use the evaluate function that you suggested. However, I still couldn't get the result in report.
    Here is part of my logical layer (BMM):
    Dim - Time: TIME_KEY, ...
    Dim - Client: CLIENT_KEY, ...
    Fact - Encounters: # Visits ( i.e., count(distinct(EVENT_ID) )
    The above fact table contains foreign keys (TIME_KEY, CLIENT_KEY, etc.) to all dimension tables in the physical layer.
    My requirements:
    I need to generate a pivot report that has the following information:
    Rows: Translated categories based on # Visits (from Fact - Encounters; for example: 1-5, 6-10, ...)
    Columns: Fiscal Year (from Dim - Time)
    Measures: # distinct Clients (from Fact foreign key)
    Measures: Percentage of # distinct Clients (from Fact foreign key)
    Last Row: Average # distinct Clients in each of the Fiscal Year columns
    Somehow I could only get the correct measures when I used aggregation rule=count distinct for the CLIENT_KEY foreign key column in the "presentation layer". However, I know this is not the right way to count foreign keys in the presentation layer. Do you know the correct way to get to this report?
    Thanks.
    Andy

  • How to call operating system(windows) functions like sutdown,refresh,et

    Hello,
    I am new in Oracle D2k.I want to know that how to call windows XP/7 shell commands(operating system functions) or windows function key(like F5 for system refresh in windows xp/7) in an Oracle Form.
    Actually I have to make a trigger which can fire at pressing a particular key and execute appropriate action of Windows7 like shutdown,F5(function key of windows to system refresh).
    thank you
    regards
    aaditya.

    Just for future reference, regardless if you are posting in the Forms area of the forum or any other, terms like Forms 11g, Oracle 11g, etc are parts of product names. They are not version numbers although they do offer a slight hint. It is very important that when posting you include the complete version number of any products related to the problem or question you have. For example, you said you are using Oracle Forms 11g. Look at how many possible versions "Forms 11g" could possibly be:
    11.1.1.1
    11.1.1.2
    11.1.1.3
    11.1.1.4
    11.1.1.6
    11.1.2.0
    11.1.2.1
    With each new patch release and major release, a large number of bug fixes are included. In the case of new major releases, in addition to bug fixes, many new features are added. So knowing the version number is important.
    Beyond that, it would appear that you have many questions:
    1. How to copy and paste
    2. How to execute a system shutdown
    3. How to force the browser into full screen mode
    4. Refresh - this one is unclear. What do you mean by "refresh"?
    Let me answer those that I can:
    <blockquote>o Functions like cut/copy/paste are available directly from your Forms code. For these I would recommend referring to the Builder's Online Help. Look for CUT_REGION, COPY_REGION, PASTE_REGION. It might also be helpful to understand SELECT_ALL. For example you may want to code a Copy button like this:
    GO_ITEM('some_text_field);
    SELECT_ALL;
    COPY_REGION;o To execute a system shutdown on the client machine, you would first need to WebUtil enable your form. Refer to the Forms Builder Online Help for information about how to use WebUtil. You can also find lots of information in this forum about WebUtil. Once enabled, you can execute a Windows shutdown in various ways. Here one option:
    Declare
         my_cmd varchar2(255);
    Begin
         my_cmd := 'cmd /c start "" "' || '"shutdown -s -f -t 1"' || '"';
         WEBUTIL_HOST.HOST (my_cmd);
    End;Refer to the Microsoft documentation for more information: http://technet.microsoft.com/en-us/library/bb491003.aspx
    o I'm not sure what you are attempting to do with the F11. I understand that this function key sets the browser to full screen, but the form will not exactly adjust for this change in browser size. You can adjust the applet size dynamically, but not the form. For that you would need to code the behavior yourself. So, before I can offer something specific, it would be helpful to understand what you expectation is and if what you want is to set the browser to full screen, why not just allow the end user to do it? You could easily have a java script popup displayed before the form starts which might say something like "To maximize your browser, press F11"
    o Finally, "refresh". I don't know what you mean here. Refresh what? The Windows desktop, browser, Oracle Forms.....
    </blockquote>

  • "All windows" function crashing macbook pro

    Hi,
    I'm having problems with the "All Windows" function that is on the F3 key (macbook pro mid 2010 on Snow Leopard) that I put in my active screen corners or Hot corners as I thought they were called. I bound the "All Windows" function to my bottom left corner and find myself occasionally crashing the whole computer if I use it when I have a few applications open. Sometimes it happens when I have a lot open and sometimes not so much i.e. Safari, Chrome, Skype (with no calls going) and itunes. Sometimes I feel I do an action too abruptly and it crashes, say I open a page in a browser thats still loading, go straight to "all windows" to go see something else and the screen goes black and any noise that was playing keeps skipping. The only way out is to reboot.
    I remember having an issue with gfxcardstatus when I upgraded from v2.1, in which my screen would go black with a line of pixels up top that was screwy. The rest of the computer was fine. Reboot wasn't necessary to fix that. Once I reverted to v2.1 all was fine again. I don't know if gfxcardstatus has anything to do with what I'm dealing with currently but as far as I can remember thats the only problem i've had with this computer until now.
    Otherwise I also upgraded from 4Gb of RAM to 8 back in september but have only been having this issue for the past few months. I don't know if it's my RAM that maybe be faulty.
    All that I know is that "All Windows" function recently crashed the computer. I'm not sure if it does it with my other hot corners which are bound to "Spaces" since I don't recall what I was doing when I crashed other times (more than a dozen times).
    Any insight would be greatly appreciated.
    Thanks

    I've been verifying Activity Monitor while using the "All windows" function and its CPU usage (Process name of  WindowServer) jumps to 10-15% when I use the function. Could it be just that simple that the computer just crashes if this were not enough CPU available when I use "All windows" or is my RAM or computer faulty for crashing at that CPU jump.

  • "SCR24 style lid with window function".And only one adaptor for DK48

    I recently purchased the product "SCR24 style lid with window function". The contents of the box is the adapter for the "dock" DK48, the problem that I find is that I have two DK48 and only one adapter. Is official that the Sony's answer is:" every time you want to charge, remove from the dock and put on the other. There is no spare part, cant purchase it separately"?.

    I've searched the places I use for parts and cases etc but no adaptors - The only thing I can think of doing is to buy a magnetic charging cable and use that
    For a successful technology, reality must take precedence over public relations, for Nature cannot be fooled.   Richard P. Feynman

  • NBDirector window function not available

    Running OS X 10.7.5, Safari 6.1.6
    Getting an error message listing URL and "NBDirector window function not available",   Is this a site issue or an OS/Safari issue?  If the latter, how to fix?

    Hi ..
    Make sure your OS X software is up to date.
    Open System Preferences > App Store then click: Check Now

  • Subquery removal using window functions

    Hi,
    DB is 9.2.0.8 EE .
    select * from FROM bt_osoby osoby , bt_osoby_firmy osf1
    WHERE osoby.osb_audyt_st = '1'
      AND osf1.osf_audyt_st = '1'
      AND osoby.osb_id = osf1.osf_osb_id
      AND osoby.osb_nzm_id != 4140963  
      AND osoby.osb_id = ( SELECT MAX (osoby2.osb_id)
                             FROM bt_osoby osoby2
                             WHERE osoby2.osb_audyt_st = '1'
                             AND osoby2.osb_nzm_id = osoby.osb_nzm_id) I'm trying to rewrite above with subquery removal using window functions trick.
    select * from bt_osoby osoby , (
      SELECT first_value(osoby2.osb_id) over (partition by osoby2.osb_nzm_id order by osoby2.osb_id desc nulls last) max_osb_id ,osoby2.osb_nzm_id o2_osb_nzm_id
                             FROM bt_osoby osoby2
                             WHERE osoby2.osb_audyt_st = '1') v
                             ,bt_osoby_firmy osf1
                             where
                             osoby.osb_audyt_st = '1'
      AND osf1.osf_audyt_st = '1'
      AND osoby.osb_id = osf1.osf_osb_id
      AND osoby.osb_nzm_id != 4140963
      AND   v.max_osb_id = osoby.osb_id
      AND osoby.osb_nzm_id = v.o2_osb_nzm_idbut rewritten query plan involves huge FTS on BT_OSOBY (much worst then NL over sub query before), how to
    benefit from 'subquery removal using window functions' then?
    Regards.
    GG

    Hi,
    As you discovered, a query with a sub-query can be more efficient that one without a sub-query.
    I would do this using the analytic RANK function (or, depending on your needes, maybe ROW_NUMBER).
    WITH     bt_osoby_with_rnum     AS
         select  bt_osoby.*
         ,     RANK () OVER ( PARTITION BY  osb_nzm_id
                               ORDER BY          osb_id     DESC
                        ) AS rnum
         FROM      bt_osoby
         WHERE     osb_audyt_st     = '1'
         AND     osb_nzm_id      != 4140963  
    SELECT     *     -- or list all columns except rnum
    FROM     bt_osoby_wtih_rnum             osoby
    ,      bt_osoby_firmy                 osf1
    WHERE      osf1.osf_audyt_st  = '1'
    AND      osoby.osb_id = osf1.osf_osb_id
    ;Of course, without versions of your tables, I can't test this.
    Note that this does use a sub-query.

  • How can I implement a model (DialogResult) window function?

    //Popup extends Stage,
    Popup popup=new Popup(primaryStage,title,content);
    DialogResult result=popup.show();
    if(result==DialogResult.ok)//if user doesn't close stage, this line isn't triggered.
       //my next code here...
      public enum DialogResult
             OK,
             Cancel,
             Yes,
             No,
             None
        } Actually,I implemented Popup based on Stage, and I created a lot of customized control in popup,I'd like to wait for the Dialogresult value if user do something on my popup,if user doesn't close stage, if(result==DialogResult.ok) isn't triggered.any suggestion?
    Edited by: imtoocute on Apr 30, 2012 1:41 PM

    This has got to be one of the most asked questions on the forum - I guess because (with the exception of JavaFX 2.0), every UI technology known to man has had this functionality built-in since their first version.
    There are a few different ways to achieve this:
    See:
    Dialog Box Problem "Dialog Box Problem"
    https://gist.github.com/1887631 "     JavaFX Modal Confirm Dialog Box Example"
    http://javafx-jira.kenai.com/browse/RT-19783 "Provide an option to allow modal windows to be blocking" (implemented for 2.2)
    http://javafx-jira.kenai.com/browse/RT-12643 "Add javafx.scene.control.Alert class"
    Quick answer is that unless you are using 2.2 and can use a stage.showAndWait() function, then implement your dialog via a stage or a popup or a stackpane overlay and use callbacks on actions in the dialog to collect the result of user interaction with the dialog and resume execution.
    Hopefully that helps you.

  • Parent child window functionality using CFM

    In .cfm page I am trying to implement the following
    functionality
    I got a parent window contains a button.
    On button click a child window should get open.
    This child Window should get embed in that parent window
    (like MDI application)
    1)i.e While minimizing the parent window this child window
    should also get minimized
    2)While closing the parent window this child window should
    also get closed
    3) We should also be able to close the child window alone.
    4) If you double click on the title bar of the child window
    it should get maximized
    5) Again double click on the title bar of the child window it
    should get minimized.
    I tried with <embed> tag but it seems its for audio ,
    flash kind files.
    If we can use <embed> tag means whats should be the
    value of the "Type" attribute.
    waiting for your valuable information

    Window handlers and controls are generally a function of the
    browser and not really manipulatable using ColdFusion, as it runs
    on server-side only, not client-side. JavaScript would be more the
    thing to play with in this regard, although I don't think there is
    an "onClose" event handler.
    HOWEVER!
    All browsers have a security feature that prevents pop-up
    child windows from "hijacking" their parents window behaviors,
    including resizing, moving, changing the toolbars, closing, etc.
    This security feature cannot be bypassed, and is an integral
    hard-coded aspect of all modern browsers. I suspect that what you
    are looking to do may be impossible due to this one fact, unless
    someone knows a bypass.

  • Mac vs Windows functionality on Photoshop & Premier Elements

    Hello,
    I am very interested in purchasing both Photoshop and Premier Elements from the Mac App store however that was until I did some further investigation and found the following on Adobe's site "(Windows only) Create a slide show in Photoshop Elements 6.0 or later with captions, transitions, effects, music, narration, graphics, and titles, and then bring the slide show into Adobe Premiere Elements for further editing or to burn to DVD. Or, bring individual photos into Adobe Premiere Elements and create the slide show there." statement. This functionality is my sole purpose of purchasing the product. I am a Mac owner running Lion and I am keen to hear feedback from other Mac users who can perform this functionality (and how).
    My particular interest is that I have a slideshow that I want to put onto DVD.  I want to align songs to specific photos. For example, I have a song I want to play over my first 10 photos, then another song for a set of 5 etc, all in the one chapter so to speak.  Can anyone help? I'm finding iDVD very limited in audio allocation to groups of slides.

    Great, thank you all for your valuable input. 
    I will play around in Garage Band (as demonstrated to me by a very helpful Next Byte staff member today) and iMovie and see what I come up with. In the meantime, my aim is to eventually purchase Adobe Photoshop Elements as that will at least give me some more editing options than is currently available in iPhoto.
    Again, thank you all for taking the time to reply to my query.

  • Open URL in new window function not working.

    Please please please can someone help. The openURL function that I have linked to a button and a click box will just not work anymore in a new project. I have searched everywhere for an answer and all I can find is that it is something to do with a flash update preventing this and some code was provided as a work around. However I only have captivate 4 and 5 and have no way of editing this code to allow the new windows to function. If these functions are no longer available within captivate then captivate is nolonger any use to me. Can anyone help?

    Welcome to our community
    See if the link below is what you are after:
    Click here to view
    Cheers... Rick
    Helpful and Handy Links
    Captivate Wish Form/Bug Reporting Form
    Adobe Certified Captivate Training
    SorcerStone Blog
    Captivate eBooks

  • How do you "stop" the Recently Closed windows function?????

    I do not want Firefox to record my "Recently Closed Windows".
    How do I SHUT THAT FUNCTION OFF???
    Thanks

    Just like that,type "about:config" in the URL bar then press enter,a warning will pop up,click the "I'll be careful" button and you're there.

Maybe you are looking for

  • Safari can't download file when trying to download movies

    Safari responds with "safari can't download file' when I use download app to download movies . I don't have issues downloading apps or searching net.  Would be grateful for assistance.

  • DNS problems with Snow Leopard

    I have had this problem for a long time, but it is especially annoying me today. My Mountain Lion iMac (2012 model) is slow to establish an internet connection when it wakes from sleep. My Snow Leopard machine has a much crisper and reliable connecti

  • INTEGRATION_DIRECTORY_HMI rfc returning error 403

    Dear Experts, I have installed SAP Netweaver 7.4 PI server on windows and MS sql 2012. i have below issues which i could not get proper solution 1)RFC INTEGRATION_DIRECTORY_HMI returning error as 403: forbidden . This RFC is pointing to /dir/CacheRef

  • IPhone 4 will not charge using apple charger displays this device not supported for charging

    The iphone will connect to iTunes but will not charge with the charger or computer. It has been reset, and that didn't help.

  • Adobe Acobat 10.1.7 is slow to print

    I have a Winodws 7 Alienware computer running adobe 10.1.7. When I select a document to print I get the printer dialog box, make my selections and all is great, when I get the printer progress dialog box I get nothing for two-5 minutes then my print