only the update by removing for cursor loop

Hello

I have the cursor for loop below update a flag. Need to convert the single update by removing the loop.

po_date po_number BLACK flag

123 123 - 1 12 December 2015

123 123 - 2 December 15, 2015

123 123 - 3 December 21, 2016

Result

=====

po_date po_number BLACK flag

123 123 - 1 12 December 2015 MUL

123 123 - 2 15 December 2015 MUL

123 123 - 3 December 21, 2016

So, if there are several BLACK for a PO_number, then Mark flag = "MUL" for the two records which are min as the max po_date.

I'm in select * from alm_po_quotes

loop

Update alm_po_quotes

flag of the value = 'MUL '.

where po_number = i.po_number

and

po_date < (select MAX (po_date) in the alm_po_quotes where po_number = i.po_number);

end of loop

Commit

Please notify.

Thank you

In your update, simply add the clause as below

-Statement to merge

MERGE INTO alm_po_quotes apq

USING (SELECT MAX (po_date), mxpo_date,

APQ.po_number

Of alm_po_quotes apq

GROUP BY apq.po_number

After HAVING COUNT (DISTINCT apq.crno) > 1

) q1

WE (apq.po_number = q1.po_number

AND apq.po_date<>

WHEN MATCHED THEN

UPDATE SET apq.flag = 'MUL '.

;

-Update statement

UPDATE alm_po_quotes apq SET apq.flag = 'MUL '.

WHERE apq.po_date< (select="" max(po_date)="">

Of alm_po_quotes apq1

WHERE apq.po_number = apq1.po_number

GROUP BY apq1.po_number

After HAVING COUNT (DISTINCT apq1.crno) > 1

);

OUTPUT:-

=======

PO_NUMBER CRNO PO_DATE FLAG
123 123 1 12/12/2015 MUL
123 123 2 15/12/2015 MUL
123 123 3 21/12/2016 -

Tags: Database

Similar Questions

  • My creative cloud has been slain in "the update installation" 5% for days now "

    I have a macbook and the creative cloud installedScreen Shot 2016-02-20 at 23.03.49.png, and he's been stuck in "The Update Installation" 5% for several days now.

    This is what it looks like, I don't know what to do because he said I can't same Unistall it.

    Help, please.

    Hello

    Please try the following steps to resolve this problem.

    (MAC)

    (1) close adobe all processes in the activity monitor (cloud Creative), synchronization of the base, CC, ccx, services for the desktop application adobe, adobe office, CIB Adobe updater AAM Broker service

    2) navigate to the following locations and assign all permissions to the adobe folders to the current user. To navigate, click on go in the bar on then click goto... type/library/application support of / and then click OK.

    (3) to assign the authorization right click on adobe folder and click on Get info... A window will open. Then click on the lock symbol to allow editing. Then click on sign + to add your user name. Then change read only to read and write. Then click gear icon on the bottom and click on apply to the elements included and click ok... Go to the next step then.

    3) navigate to the location following support/adobe application and rename in oobe to oobe.old and aamupdator.old aamupdator.

    (4) place you ~/Library/application support/adobe/oobe and rename in oobe to oobe.old and aamupdator.old aamupdator.

    Cloud creative library and remove 5 open application).

    (6) open utility library of the application itself and delete Adobe application manager and creative cloud

    (7) install creative cloud from link according to https://creative.adobe.com/products/creative-cloud

    (8) launch cc app and it should work properly

  • I try to install the update of security for Microsoft Office System 2007 (KB972581), but if failed and I get the error code Code 57A__

    I try to install the update of security for Microsoft Office System 2007 (KB972581), but if failed and I get the error code Code 57A

    I have install the 2007 Microsoft Office Suite Service Pack 2

    I bet that if you check the size of the file that has been downloaded it will be probably very small, indicating that it was not downloaded correctly.

    I don't think you have another computer at hand, or a friend with a USB key which may be able to download and copy it for you?  Maybe burn it to a CD or something.

    I could download it and save it to my desktop so I am confident that it is not a problem with the link itself or the file is available for download with success.

    I know this isn't a very good suggestion, but the only other option would be to challenge support and see if a technician can take control of your machine and see if they can solve the problem of internet explore.

    If you find my answer was what you're looking for, remember to click on the box "mark as answer" below!

  • Try to install the Update Rollup 2 for Windows XP Media Center Edition 2005 - on SP3.

    Hello

    All this started when my Xbox360 is dead, sent it for repair, came home another, all hung up and tried to connect to the Media Center. Of course, it did not work and the screen says to uninstall? (something), I forgot today, it has been a long road since then. BUT I uninstalled Update Rollup 2 for Windows XP Media Center Edition 2005 and updates that came after. NOW realize it was a mistake, I'm not of the Update Rollup 2 for Windows XP Media Center Edition 2005 on your computer. And I'm confused regarding why, for the first time, that I can't find a single KB article on this problem.

    And even if I did not restore the system off, there is no restore point on my machine.

    So I'm always searching in google and microsoft.com but a little lost right now.

    Moccan,
    Thanks for posting on the Microsoft answers Forum.  I would like to know if you read this article for the hotfix rollup: http://support.microsoft.com/kb/900325.  In particular the section more information, which has this:

    If the 886904 update is installed, you must uninstall the 886904 update before you install the Update Rollup 2 for Microsoft Windows XP Media Center Edition 2005. Otherwise, the installation of .NET Framework 1.1 SP1 will fail.

    To determine whether the 886904 update is installed, follow these steps:

    1. Click Start, click run, type appwiz.cpl, and then click OK.
    2. Click to select the Show updates check box.
    3. In the currently installed programs list, look for the following element:
      Fix for Microsoft .NET Framework 1.1 (KB886904)

    If you see this option, you must remove the hotfix. To remove the patch, click Microsoft .NET Framework 1.1 Hotfix (KB886904), and then click Remove. Then, visit the Windows Update Web sit to download and install the Update Rollup 2 for Windows XP Media Center Edition 2005.

    If you haven't checked out on this yet, then follow the steps below and let us know the result. Mike - Engineer Support Microsoft Answers
    Visit our Microsoft answers feedback Forum and let us know what you think.

  • Encountered the error 80070003 while trying to install the update of security for Windows 7 for x 64-based systems (KB2286198)

    I tried to install the update several times, but I get the same error every time ' encountered error 80070003 while trying to install the update of security for Windows 7 for x 64-based systems (KB2286198).

    I tried to use products different a.v. to search for the virus, the male ware, kits root and found nothing.

    Ran the update without any firewall or AV program running and still received the same error.

    AMD Turion 64 X 2 Mobile, Windows 7 Ultimate 64, 4 GB ram, 42 GB of 110 GB of free space on the drive, 4 GB page file.

    Hi a93svtf,

    This problem occurs when some files in the update are missing, even if the update is downloaded and extracted successfully.

    Step 1: Run the fixit available in the article below

    You receive an error '0 x 80070002' or '0 x 80070003' code after you download an update from Windows Update, Microsoft Update or Windows Server Update Services

    http://support.Microsoft.com/kb/910336

    Step 2: Auditor of file system (CFS) scan to fix all of the corrupted system files. To do this, follow the steps mentioned in the link below:

    How to use the System File Checker tool to fix the system files missing or corrupted on Windows Vista or Windows 7

    http://support.Microsoft.com/kb/929833

    Now, try to install the update

    Thank you, and in what concerns:

    Ajay K

    Microsoft Answers Support Engineer

    Visit our Microsoft answers feedback Forum and let us know what you think.

  • Code error 8024002d when you use Windows Update to install the update of security for Director 2.6 for windows vista

    I get the error code 8024002d message when you use Windows Update to install the update of security for Director 2.6 for windows vista. It try to install then a window pops up saying: he cannot locate a file called "MM26_ENU [1] .msi '. I have serached my PC and no such file exisits. Grateful for any help. This is supposed to be an update of important safety for Movie Maker.

    Alan McC
    Do you have other accounts of users on this PC?  If you install this update from the main account?

    You should get the number of the update of the updated history list and then download the file here: Microsoft downloads.
    If sure that nothing else is running, and then install the update manually.  Give it a try and let us know the results.

    Mike - Engineer Support Microsoft Answers
    Visit our Microsoft answers feedback Forum and let us know what you think.

  • Problem, reinstall the Update Rollup 2 for Windows XP Media Center Edition 2005

    I have problems with MCE 2005.  My hard drive crashed and the technician that restored my repressive said that he could not work in MCE 2005.  It's a shame because he was working before the hard drive crashes.  I work with windows XP.
    When I go to install the internet and begin to test the connection it gives me "Critical error of process - Code 2"
    When I go to the TV configuration, it tells me "Tuner not found".  Even if I know it works because I also Win TV7 in Hauppauge. My TV tuner is HVR-1600.
    With these problems, I thought that the solution might be to reinstall rollup 2 according to the Microsoft.
    http://support.Microsoft.com/kb/910905
    However, when I go to reinstall the Update Rollup 2, it seems to be to establish a restore point and then it stops when it hits hotfix (KB891593).
    I took a copy of the mcelog and have attached a copy of the log below.

    Assistance or management, you can provide me to solve this problem would be highly appreciated.

    At this point, I'm a newbie to this and I don't have a clue as to the cause of my problems and any ideas you may have for me would be much appreciated.

    A generic Package: 10/28/10. 21:32:48
    Looking for an existing installation of the generic package

    A generic Package: 10/28/10. 21:32:48
    Looking for an existing installation of the generic package
    Process creation: WindowsMedia10-KB895572 - x 86 .exe/quiet /norestart
    Process returned 0 x 00000000

    Function (ExecCmdInThread) Message of Post for the Package id: 1045.

    A generic Package: 10/28/10. 21:33:02
    Looking for an existing installation of the generic package
    Process creation: WindowsXP-KB891593 - x 86 .exe/quiet /norestart
    Process returned 0 x 00000000

    Function (ExecCmdInThread) Message of Post for the Package id: 1046.

    A generic Package: 10/28/10. 21:33:02
    Looking for an existing installation of the generic package

    Process creation: WindowsXP-KB895961 - x 86 .exe/quiet /norestart
    Process returned 0 x 00000000

    Function (ExecCmdInThread) Message of Post for the Package id: 1047.

    A generic Package: 10/28/10. 21:33:02
    Looking for an existing installation of the generic package
    Process creation: WindowsXP-KB899337-v2 - x 86 .exe/quiet /norestart
    Process returned 0 x 00000000

    Function (ExecCmdInThread) Message of Post for the Package id: 1043.

    A generic Package: 10/28/10. 21:33:02
    Looking for an existing installation of the generic package
    Process creation: WindowsXP-KB899510 - x 86 .exe/quiet /norestart
    Process returned 0 x 00000000

    Function (ExecCmdInThread) Message of Post for the Package id: 1043.

    A generic Package: 10/28/10. 21:33:02
    Looking for an existing installation of the generic package
    Process creation: WindowsXP-KB888795 - x 86 .exe/quiet /norestart
    Process returned 0 x 00000000

    Function (ExecCmdInThread) Message of Post for the Package id: 1043.

    A generic Package: 10/28/10. 21:33:02
    Looking for an existing installation of the generic package
    Process creation: WindowsXP-KB902841 - x 86 .exe/quiet /norestart
    Process returned 0 x 00000000

    Function (ExecCmdInThread) Message of Post for the Package id: 1043.

    A generic Package: 10/28/10. 21:33:02
    Looking for an existing installation of the generic package
    Creation process: KB900325.exe/quiet /norestart
    0x00000bc2 returned by process

    Function (ExecCmdInThread) Message of Post for the Package id: 1048.

    "Creative process: c:\0f7019deb34a2ccd3d5c2a4d9e4f3e57\bin\wmfdist95.exe/q: a/r: n /C:"wmsetsdk.exe/WMFDIST/q/r: n /DisallowSystemRestore.
    Process returned 0 x 00000000

    Function (ExecCmdInThread) Message of Post for the Package id: 1044.

    A generic Package: 05/12/11. 21:26:14
    Looking for an existing installation of the generic package

    A generic Package: 05/12/11. 21:26:53
    Looking for an existing installation of the generic package
    Process creation: WindowsMedia10-KB895572 - x 86 .exe/quiet /norestart
    Process returned 0 x 00000643

    Function (ExecCmdInThread) Message of Post for the Package id: 1045.

    A generic Package: 06/03/12. 21:27:50
    Looking for an existing installation of the generic package

    A generic Package: 06/03/12. 21:28:23
    Looking for an existing installation of the generic package
    Process creation: WindowsMedia10-KB895572 - x 86 .exe/quiet /norestart
    Process returned 0 x 00000643

    Function (ExecCmdInThread) Message of Post for the Package id: 1045.

    A generic Package: 12/02/13. 09:44:39
    Looking for an existing installation of the generic package

    A generic Package: 12/02/13. 09:45:16
    Looking for an existing installation of the generic package
    Process creation: WindowsMedia10-KB895572 - x 86 .exe/quiet /norestart
    Process returned 0 x 00000643

    Function (ExecCmdInThread) Message of Post for the Package id: 1045.

    A generic Package: 12/02/13. 10:11:58
    Looking for an existing installation of the generic package

    A generic Package: 12/02/13. 10:12:30
    Looking for an existing installation of the generic package
    Process creation: WindowsMedia10-KB895572 - x 86 .exe/quiet /norestart
    Process returned 0 x 00000643

    Function (ExecCmdInThread) Message of Post for the Package id: 1045.

    Hi kwanray,

    Welcome to the Microsoft community. According to the description of the problem, you can not reinstall the Update Rollup 2 for Windows XP Media Center Edition 2005.

    I'll help you with this problem. I suggest you follow the steps in the article.

    Update Rollup 2 for Windows XP Media Center Edition 2005

    Reference: Support for Windows XP Media Center Edition 2005

    Let us know if you need help with Windows related issues. We will be happy to help you.

  • Cannot install the update of security for the Microsoft Visual C++ 2010 Redistributable Package (KB2467173)

    I can't install the update of security for the Microsoft Visual C++ 2010 Redistributable Package (KB2467173).

    According to Microsoft Update, the error code is 0 x 643.

    I tried to install the update during a clean boot without result.

    Here is the log: https://skydrive.live.com/redir?resid=DDC6388AB2460543! 117

    Hello

    Method 1
    I suggest you to run the fixit from the following link:

    The problem with Microsoft Windows Update is not working
    http://support.Microsoft.com/mats/windows_update/

    Method 2
    I would say you can do clean boot and install the update.

    How to configure Windows XP to start in a "clean boot" State
    http://support.Microsoft.com/kb/310353

    Note: Make sure that you reset the computer back to normal once the diagnosis is complete.

    Method 3
    I suggest you to download and install the update from the Download Center.

    RTM of Microsoft Visual C++ 2010 redistributable MFC security update
    http://www.Microsoft.com/en-US/Download/details.aspx?ID=21576

    Method 4
    I suggest you try the steps from the following link:

    Cannot install updates in Windows Vista, Windows 7, Windows Server 2008 and Windows Server 2008 R2
    http://support.Microsoft.com/kb/2509997

    Note:
    this section, method, or task contains steps that tell you how to modify the registry. However, serious problems can occur if you modify the registry incorrectly. Therefore, make sure that you proceed with caution. For added protection, back up the registry before you edit it. Then you can restore the registry if a problem occurs. For more information about how to back up and restore the registry, click the following article: http://support.microsoft.com/kb/322756
    Note: Running chkdsk on the drive if bad sectors are found on the disk hard when chkdsk attempts to repair this area if all available on which data can be lost.

  • The system is unable to complete the update of security for Windows XP (KB2661637).

    Original title: update security for Windows XP (KB2661637)

    The system is unable to complete the update of security for Windows XP (KB2661637).  How can I get my system to accept the update?

    Hi Joseph,.

    You receive messages or error codes?

    You can reset the default Windows Update components and check if you can install the update.

    How to reset the Windows Update components?

    You can also try to download the standalone update package and check.

    Update security for Windows XP (KB2661637)

  • Impossible to install the update of security for Windows XP (KB2476490) get error Code: 0 x 80070008

    Help!  I have Windows XP Edition version 2002 SP3 family.  I tried to install the update of security for weeks and get the following message:

    Cannot install get a security update for Windows XP (KB2476490) error Code: 0 x 80070008.   It is said it is downloaded on my PC but have been unable to find it or fix it.  Any help would be really appreciated.

    Unable to upgrade operating system at this time... no money.     Thank you!

    Hello

    I suggest you try the steps from the link below and check if it helps.

    http://support.Microsoft.com/kb/836941

    Hope this information is useful.

  • my computer will not install the update of security for Windows XP (KB2481109)

    Moderator before go Note: IE8.
    -----

    my computer will not install the update of security for Windows XP (KB2481109) can you help me.

    Hello

    (a) don't you try to install the update manually?

    (b) you get any error message?

    (c) don't you make changes to the computer until the problem occurred?

    (d) what anti-virus software is installed on your computer?

    I suggest you try the steps below and check if it helps

    Method 1:

    If you have installed a security software on the computer, then I suggest you to temporarily disable a software antivirus installed on the computer and check if the same problem occurs

    Note: Please make sure that you activate the software of Antivirus\Firewall after the test to keep your computer protected.

    Method 2:

    I would say as you try to perform the clean boot and then try to install the update and check if it helps, here is the link:

    http://support.Microsoft.com/kb/310353

    Make sure that return you the computer to a normal startup mode once it's done.

    Additional information: make reference in the link below:

    http://support.Microsoft.com/kb/2481109

    Hope this information is useful.

  • Update Windows guard invites me to install the update of security for Microsoft Visual C++ 2005 Service Pack 1 Redistributable Package (KB2538242) after I have already installed.

    Update Windows guard invites me to install the update of security for Microsoft Visual C++ 2005 Service Pack 1 Redistributable Package (KB2538242) after I have already installed.

    Hello

    Thanks for posting in answers.microsoft.com

    So that we can fix that Mr is that we do a clean boot using msconfig

    1. Click Start, click Run, and type "msconfig".
    2. In msconfig go to services and hide all microsoft services, once's done it to disable all other services
    3. in msconfig again go to the Startup tab and disable all startup programs
    4. Restart the computer anddo updates
  • When I check the updates, it goes into endless loop and never off.

    Original title: windows updates

    When I check the updates, it goes into endless loop and never off. Even if there is no new update, he said usaly. What is gpoing?

    Please run the Windows Update Troubleshooter:
    http://go.Microsoft.com/?linkid=9830262

    Please provide details of any problem it reports as not fixed.

  • FRM - 40603:Records is no longer reserved for the update. Query for changes

    Hi I have a form that has been developing 6i and upgraded to 11g form work well in 6i, but when I try to do the same function in 11g get this error

    FRM - 40603:Records is no longer reserved for the update. Query for changes
    When I commit this execute_query (for_update); It is the form to clear values when it loads, the error comes when I try to delete

    How can I do this

    Action: If you want to change the block, you will need to re - interview.

    Captureerror3.PNG

    I use When-Timer-Expired (WTE) trigger

    You have a 'relationship' defined between the blocks of your master and detail? If so, simply update your master block and the block of details will automatically be re-interviewed. If you cannot use a relationship, then you can use can create a timer in the trigger that updates the database, then in the trigger When-Timer-Expired (WTE) you can go to the retail block and run a query. For example: / * the sample on change trigger * /.

    DECLARE
      timer_id  TIMER;
    BEGIN
    ....your code here that performs the update....
      /* Now create an instance of a timer */
      timer_id := Create_Timer ('upd_detail',1,NO_REPEAT);
    END;/* Sample Form Level When-Timer-Expired trigger */
    DECLARE
      timer_id  TIMER;
    BEGIN
      -- Find the timer first
      timer_id := FIND_TIMER('upd_detail');
      IF NOT ID_NULL(timer_id) THEN
          GO_BLOCK('DETAIL_BLOCK');
          Execute_Query;
      END IF;
    END;
    
  • I transferred my Lightroom 5.7.1 my cell phone to my PC. I put in the serial number, you press "next" and another box came up saying that the updated code was for and upgraded version and I should put in the old version the serial number - this I can't f

    I transferred my Lightroom 5.7.1 my cell phone to my PC. I put in the serial number, you press "next" and another box came up saying that the updated code was for and upgraded version and I should put in the old version the serial number - this that I can't find

    you will need to this previous version number and serial number.

    If you purchased the previous version of adobe or registered with adobe, check your account: ID Adobe

    in otherwise, find the serial number of your product Adobe quickly

Maybe you are looking for