Getting the value of a column based on the value of another column in a max group

Please let me know if there is a simple way to do it.  I came up with a way, but it is terribly inefficient and it must work quickly.

GROUP_ID NO_REGISTRE READ_VALUE QUARTERLY

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

2 1 0.035 00:00:00.000000000 01/01/2015

2 0.035

3 1 1.11 14:50:32.943000000 14/07/2015

3 2 222 01/01/0001 13:36:47.017436000

3 223.11

So what I need is for all no_registre is NULL, I need the value of QUARTERLY for the QUARTERLY to the MAX (READ_VALUE) for this GROUP_ID (not counting the rows where the no_registre is NULL).  So the result would look like this:


GROUP_ID NO_REGISTRE READ_VALUE QUARTERLY

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

2 1 0.035 00:00:00.000000000 01/01/2015

2 0.035 00:00:00.000000000 01/01/2015

3 1 1.11 14:50:32.943000000 14/07/2015

3 2 222 01/01/0001 13:36:47.017436000

3 223.11 13:36:47.017436000 01/01/01

Someone at - it ideas?

Or maybe:

-production of the sample data:

WITH t (GROUP_ID, no_registre, READ_VALUE, QUARTERLY)

AS LONG AS)

SELECT 2, 1, 0.035, TIMESTAMP ' 2015-1-1 00:00:00 ' FROM DUAL

UNION ALL SELECT 2, NULL, 0.035, THE DOUBLE NULL

UNION ALL SELECT 3, 1, 1.11, TIMESTAMP ' 2015-07-14 14:50:32 ' FROM DUAL

UNION ALL SELECT 3, 2, 222, TIMESTAMP ' 0001-1-1-13:36:47 ' FROM DUAL

UNION 3 SELECT ALL, NULL, 223.11, NULL FROM DUAL

)

--

-actual query:

--

Select group_id

no_registre

read_value

, last_value (quarterly) ignores NULL values over (partition by arrested by no_registre last read_value null, group_id) quarterly

t;

Tags: Database

Similar Questions

  • I get the message "system restore has been transformed to group policy. to turn on system restore contact your domain administrator"does that mean

    I get the message "system restore has been transformed to group policy. to turn on system restore contact your domain administrator"does that mean

    This means that the function of system restore has become disabled, possibly through a group policy.

    To re - activate:

    1. click on start, run and type regedit.exe, and then press enter

    2. navigate to the following key:

    HKEY_LOCAL_MACHINE-Software-policies-Microsoft-Windows NT------SystemRestore

    In the right pane:

    1 delete the value DisableConfig
    2 delete the value DisableSR
    3. exit the registry editor.
    4 reboot.

    In Windows XP Professional, you can accomplish the above by using Group Policy Editor.

    1. click on start, run and type GPEDIT. MSC
    2. navigate to this path:

    Computer configuration-> administrative templates-> system-> system restore

    3. set turn off unconfigured system restore
    4. set the disable configuration not configured
    5. exit the Group Policy Editor
    6 reset.

  • I can't Live Update my Max Total Security that I get the message "DB update failed download!» Max Support also did not help at all. Disappointing. What should do?

    I can't Live Update my Max Total Security that I get the message "DB update failed download!» Max Support also did not help at all. Disappointing. What should do?

    Do yourself a favor and remove the application.  Mac do not need AV applications and at best, they will be not hard (but not good either) and at worst will corrupt your system / OSX's built in protection.  Your concerns are malicious software that requires the cooperation of the user to install, not the virus.

    For more information, please read this:

    http://www.thesafemac.com/

    Ciao.

  • How do I get the content from another file and paste it into the active document instead of certain string?

    I am newbie in indesign scripting of animals. So I apologize because I couldn't post my essays.

    Objective:
    I have a .indd document which will be a figure of legend, label etc. I need to copy the content (a figure that is editable) else file indd of this document where the tag figure exists.

    For example:
    Sample.indd

    Some text Fig.1.1 caption some text 

    I need to copy the contents of figure1.indd and paste in the document sample.indd where Fig.1.1 string exist and so forth. Now I do it manually. But am supposed to automate this process.

    So, I need some hint how to do it using extendscript?

    I found something like below, to do so, but I have no idea to develop it further and also do not know if this approach is correct my results. Please help me

    myDocument=app.open(File("file.indd"),false); //opening a file to get the content without showing.

    myDocument.pages.item(0).textFrames.item(0).contents="some text"; //here I could set the content but I don't knw how to get the content

    // ?????? Then I have to paste the content into active document.

    Try this test nicely to your and end, hope this will help you.

    var myDoc = File("/D/Sample.indd");//Figure File
    var myFigDoc = File("/D/Figure.indd");//Destination File
    app.open(File(myFigDoc));
    app.activeDocument.pageItems.everyItem().select();
    myObj = app.selection;
    var myGroup = app.activeWindow.activePage.groups.add(myObj);//Grouping the objects
    myGroup.select();
    app.copy();
    app.open(File(myDoc));
    app.findGrepPreferences = app.changeGrepPreferences = null;
    app.findGrepPreferences.findWhat = "Fig 1.1";//Figure caption text
    app.findGrepPreferences.appliedParagraphStyle = "FigureCaption";//Figure Caption Style
    myFinds = app.activeDocument.findGrep();
    for(var i=0;i		   
  • Impossible to access the system restore, getting the error "system restore has been disabled by group policy.

    Recently, I was hit by a virus that, among other problems, he blocked my access to the system restore to clear it. After having had my pc repaired I can not even access the system restore or my registry. I get a message from that system restore has been disabled by group policy. It's my own pc and I am the administrator. I've tried a few things without success. I hope someone can help me with this. I have the vista operating system.

    1. click on start, run and type regedit.exe , and then press enter

    2. navigate to the following key:

    HKEY_LOCAL_MACHINE-Software-policies-Microsoft-Windows NT------SystemRestore

    In the right pane:

    • Delete the value DisableConfig
    • Delete the value DisableSR

    3. exit the registry editor.

    Other tips, tricks and support are available at: www.waltwachon.weebly.com

  • Double-click on icon and get the installer for another program. How can I fix on Vista and Win7?

    Something about 2 PC is corrupt.  For some programs when I try to launch Windows install start to a different program.  Up to 3 times cancel can be reequired before the start of the program you want.  This happens on Vista and Windows 7

    Where can I look for to get rid of this?

    Hello

    1. you remember to make changes to the computer before this problem?

    Step 1:

    You can read the following article and try the Fixit to solve the problem.

    When you run an .exe on a Windows Vista-based or Windows 7 computer file, the file may start another program

    Step 2:

    There is a problem with the file association. Check the article mentioned and try the steps outlined in the article.

    Change the programs that Windows uses by default

    You can see the following article for Windows 7.

    Change defaults to programsWindows

    Step 3:

    You can also check the following link and try to download the Microsoft Safety Scanner and perform a full scan on your computer and check.

    Microsoft safety scanner

    Note: When you perform the analysis, there are risks of data loss you can take a backup of important data before performing analysis.

    Hope this information is useful.

  • Get the payment to another country (in development)

    Hello

    My question is on the app payments. We want to create a new application and our operations will be in Turkey, but our base is in Dubai. What is Apple's policy regarding payment? What is the procedure of the transfer to the country of anouther? How can we get our money in the UNITED Arab Emirates?

    Thank you

    Apple's policy is that they will pay to any authorized bank where you have a valid account, regardless of where you work. In this example, there is no 'transfer '.

  • I have a Photoshop Elements 5.0 reloading problem on my PC. Get the error 1500 "another Installation in projgress.

    I have a Photoshop Elements 5.0 reloading problem on my PC. Layout error 1500 "Another Installation in progress". Can anyone help with this?

    Launch the Task Manager and end all Adobe as well as other msiexec, configuration process, process of Windows install.

    then try again to install Photoshop Elements 5.0.

    If the question remains the same, restart the computer and try to install again.

    You can also check out link below:

    Error 1704 or 1500 | Install, remove | CS4 | Windows

  • How can I move my icons of the application to another page? Want to group them.

    I have iPhone 5 and too many icons on the current pages. I would like to create more pages so that I can combine them. I moved 2 icons to a new page, but for some reason any cannot drag a plus more.  Any suggestions will be appreciated.

    Press and hold the icon until it wiggles. then move... as it is since 2008.

  • How to get the value of messageStyledText that is present in the other RN

    Hello

    I have xxcompscore messageStyledText in the region 1 (separate controller) and xxobjscore messageStyledText in the region.2 (separate controller).

    The two values are doubles.

    My requirement is to get that value from another region (layout) and adds that the values and display in the RN.

    How to do this, I tried a lot but I get error NullPointerException.

    HI San,

    According to my understanding, you have the following requirement.

    xxcompscore messageStyledText in the region1 (separate controller) - Say controller is XxxRN1CO
    xxobjscore messageStyledText in region.2 (separate controller). -The controller is XxxRN2CO
    Page Layout RN - Say controller is XxxPageLayoutRNCO

    If you try to get the value of the region1 - PR Noire2 and display in Pagelayout cannot be achieved by the way you write the code...
    What follows is drawn sequence of the controller...
    1 XxxPageLayoutRNCO--> processRequest
    XxxRN1CO--> processRequest
    XxxRN2CO--> processRequest

    XxxRN2CO--> processFormRequest
    XxxRN1CO--> processFormRequest
    XxxPageLayoutRNCO--> processFormRequest

    So you can't get the session values configured in XxxRN1CO--> processRequest or XxxRN2CO--> processRequest in XxxPageLayoutRNCO--> processRequest.

    You need to take the following approach to get these values.

    -> If the underlying VO for the region1/region.2 is executed in PageLayout controller or controller of the region1
    then you can get the required values of the underlying attributes of your calculation VO do and set the value of TotalScoreText
    on the other
    If executed in the level controller VO region then you will need to run these vo also in pageLayout controller and
    get the values of the attributes of VO and do your math and set the value to TotalScoreText

    Let me know if you need assistance.

    Kind regards
    RAM

  • try to download the updates after signing to get the update message not available with this Apple ID bought by another user, refunded or cancelled

    Cannot download updates. Identify yourself accepted but then get the error message

    Did you buy or get the Mac from another user?

  • Im having trouble getting the Blizzard world of Warcraft Downloader to send the last game, tasks in my WoW folder

    The Blizzard Downloader must be used to download patches MMORPG World of Warcraft as some more small are not on the download of files and sites sites third parties with patches WoW can not be guaranteed. Ive turned off Windows Firewall, Ive even tried to create a new rule to allow port 3724 which must be open, my WoW folder is not protected and when I click on the icon to start the download I chose FUNCTIONING as administrater.

    The problem is not with my router as the downloader worked fine when I used Windows XP. The patch is stopping at 10% and then to say that it has failed. Sometimes the sound indicating there may be a firewall. (Im using Windows 7 now). I even did a trouble Shooting in my network connection

    As it looks like the source of the file is corrupted try to get the file from another source that I had that issue a couple of times on different systems of Vista where the patch would not work on 1 system but on another system of Vista

  • How to get the free license for HP Custom Image for ESXi 5.1.0

    Hi there guys.

    I have HP Proliant DL160 G6 and I installed this: https://my.vmware.com/group/vmware/details?downloadGroup=HP-ESXI-5.1.0U3-GA & productId = 285

    I would like to ask how I can get a free license for this hypervisor?

    My server supports only hypervisor 5.1, but none of the most recent versions, then told me to install the one I posted above.

    This version of the free hypervisor and how do I get the license for this last, or where I can download another more recent free hypervisor can 5.1.0?

    Thanks in advance!

    Unfortunately, you can't have the old version free license... As if you were going to a free version, you can try the latest version and key are available with them. Currently esxi 6.0.

    If you bought the license for 5.1, then you can get the license key. another sound impossible.

  • Dreamweaver connection "How can I get the user name to the other page?

    im a beginner in Dreamweaver CS4 and I'm learning to just watch the tutorial videos...

    I have a big problem...

    ADWCS4 is easy to make a login form...


    for these tutorials I watch I have not meet how to get the user to another page name which connect...

    I'm using PHP

    hope you can answer my question

    http://forums.Adobe.com/thread/417437

  • Loader will load the images from another server, but then we get error on Bitmap operation

    I develop an application that currently uses Loader to get the images to another server.  This should not work now because we are still waiting for the owner of that server to put a crossdomain in place file.  However, it works - sort of .

    Charger can load the images very well, without error.  But then the application has a feature that we are a great duplicate of the image to display in a sidebar, we do this in this way:

    var myBitmap:Bitmap = Bitmap (loader.content);

    and when will we get a Flash player 2122 security error, violation of sandbox.

    So although I hope that all this will fix itself when the crossdomain.xml file is set up, I am confused as to why we get only the sandbox error when we do a bitmap image, and not when we try to initially retrieve the image.

    (By the way: is there a better way to make a "copy" of an image loaded by a loader and change its width and height to display simultaneously in another part of the scene?)  "I have need to change its real dimensions - I just need to change its display width and height).

    Thank you!

    The sandbox allows you to view, not not editing from another server without a cross-domain.

    Therefore, when you try to load up, it loads, it 'read only' and gives you an error when you try to "change" by a new Bitmap out of it.

    This should resolve itself once crossdomain is in place.

    || EDIT |

    I just realized that I have to clarify my statement a bit more.

    When you load images from another server without a crossdomain, it only allows the load for display.  When you try to load data, it will fail.  It is because that data XML, or another type of data is editable by default, and the images are only visible by default.  As a result, the image fails when you try to convert it to an editable form.

Maybe you are looking for

  • A100-201 wireless connection loss

    Hello I bought my laptop in December and have been using broadband wireless since but yesterday he lost the wireless connection. My provider has said that it is because I need my card rank up. Is that correct, and how can I do this? I'm not very good

  • Back to Win7 XP

    Compaq 500 MT b with sitcker 'Win 7 Pro OA' with the product key.  When I bought the system I had a choice of XP pro or Win7 and I was encouraged to have xp installed.  I made a mistake and I want to convert to Win 7.  How can I do this?  Win 7 is st

  • Bad program opening

    I opened a file on my laptop windows 7 with adobe reader and now all my files and programs open only with adobe reader, how to restore the files and programs with their original settings?

  • Snap / copy the image

    I have Acrobat Pro DC on Windows 8.1. How to take a snapshot of an image in a PDF document to insert in your presentation, etc.. It allows to be the camera icon in the previous versions, I can't find it in the MS Pro Acrobat.Thank youSandeep

  • Need video help with Tungsten E2

    I had a Palm Tungsten E2 for Christmas and loved it, except its ability to play video files. I've tried everything I can think of to try to get the video files on my palm, and still, the Palm will never recognize that they are there. I tried the .mpg