Update a table with a query that uses the table updated

Hi This is my request. It's a mistake, but I hope that the basic idea may carry out. Cost_before_Decision is a column by using an alter table statement, I added:
UPDATE fraud_nov_14_final
SET Cost_before_Decision = (select Cost_Prior 
                            from    fraud_nov_14_final ff
                                  ,(select cla_case_no, sum(case when decline = 1 or decline = 2  
                                                              THEN (nvl(total_cost_adj_old,0) + nvl(decline_estimate,0)) 
                                                              ELSE Total_Cost 
                                                              END) Cost_Prior
                                    from reporting.ci_final@test
                                        group by cla_case_no) z
                                                where ff.cla_case_no = z.cla_case_no)
Error I get is:
Error report:
SQL error: ORA-01427: einreihig subquery returns multiple rows
01427 00000 - "einreihig subquery returns several lines.

Thanks in advance for your help:

Banner:
Oracle Database 11 g Release 11.2.0.2.0 - 64 bit Production
PL/SQL Release 11.2.0.2.0 - Production
"CORE 11.2.0.2.0 Production."
AMT for Linux: Version 11.2.0.2.0 - Production
NLSRTL Version 11.2.0.2.0 - Production

Try this

update fraud_nov_14_final a
   set cost_before_decision = (
                    select cost_prior
                      from (
                         select cla_case_no, sum(case when decline = 1 or decline = 2  then (nvl(total_cost_adj_old,0) + nvl(decline_estimate,0)) else total_cost end) cost_prior
                           from reporting.ci_final@test
                         group by cla_case_no
                           ) b
                               where a.cls_case_no = b.cls_case_no
                     )

Tags: Database

Similar Questions

  • How can I print with terminal server with a printer that uses a user code or identification?

    Hello

    Anyone know who to print with the Terminal Server services with a printer that uses an authentication code?

    Some printers have the ability to Setup user accounts.  When printing with the Terminal services Server the printer displays "authentication failure".

    We have customers who use XP, VISTA and 7.

    The servers run Win2003R2, Win2008, Win2008R2.

    All the drivers for the printers are installed on the client & server.

    Thank you!

    Hi Mattttie,

    Your question of Windows 7 is more complex than what is generally answered in the Microsoft Answers forums. It is better suited for the IT Pro TechNet public. Please post your question in the TechNet Windows 7 networking forum.

    http://social.technet.Microsoft.com/forums/en-us/w7itpronetworking/threads

    I hope this helps!

  • I have two Adobe Id with first ID, I used the trial version. When it expired, I did the second ID and purchased Adobe Acrobat proDC version with monthly subscription. On my first ID it shows now that I have Acrobat pro DC subscription. Second ID (the one

    I have two Adobe Id with first ID, I used the trial version. When it expired, I did the second ID and purchased Adobe Acrobat proDC version with monthly subscription. On my first ID it shows now that I have Acrobat pro DC subscription. Second ID (the one I bought the subscription) shows nothing. Now, during installation by using the ID of the first, all is going well, except using the software. He always says "your trial has expired! Using the ID of the second to make same duration does not work... I can't download the right version. Free trial only. Pleasehelp me. I'm desperate.

    Hi kimmok51975897,

    I will recommend you to contact our customer service team to get this fixed number. Follow this link Contact Customer Care, sign in using your Adobe ID (under which you subscription) & check on "still need help? Contact us' button.

    Kind regards
    Nicos

  • I need a query that selects the amount of records for each day of a table.

    I need a query that selects the amount of records for each day of a table.
    For example, the result would be:

    1 14 date
    Date 2-3

    etc.

    Any ideas?

    Sort:

    SELECT count ([IDCommentaire]), convert (varchar, dateAdded, 112)

    OF COMMENTSgroup by convert (varchar, dateAdded, 112)

  • Setting the properties of elements of façade in XControl to a VI that uses the XControl

    Hi all

    I'm new to XControls and I try to use them to make a generic digital indicator that fit into a matrix of waveforms of a similar measure and allow the user to display the first value of a waveform, it chooses by selecting the name of the desired channel in the waveform table. I have the XControl work, with a ring filled automatically with the NI_ChannelName of the input waveform array fields and the value of the ring being used to index the waveform table to select the appropriate data.

    What I want to do next is automatically set the value of control of ring in the XControl to the value that the user has selected the last time he ran the VI that uses the indicator. However, the properties of the control ring do not seem to be accessible from the VI that uses the XControl, and none of the XControl General properties seem to be accessible from the front VI in the XControl. The value of the ring is not part of the entrance of DataIn cable waveform table, so I don't have a good method to pass data to the control of the ring outside of what is in this table of waveform. I might add the value in the waveform table, if this helps, but indicators XControl do not transmit their return DataOut appellant VI to allow me to record the user selected value.

    Is there a good way to read and write the properties of façade elements in an XControl of VI that uses the XControl?

    I apologize for not posting my code; the computer with LabVIEW license is having network problems at the present time. I'll post the code when I can.

    Thank you!

    Erik

    In your State cluster typedef container, include a reference to a control of the ring.

    In your vi of façade, in the case of change of Direction, create a reference to your ring and connect to a plan by which he sends out the view state.  Also be sure to write true to the status changed in the result of the Action.

    In your xctl, select New-> property.  Name it after the property in the ring that you want to access.  Use the view clustered State (in your new property VI) to access the reference to the ring; son of a property node.  Change the control value in the appropriate type & connect to the property you want.

    Be sure to connect the path error through everything that might cause an error.

    When you drop an instance of the xctl and create a property from this node, your new property will be available.

  • Issue of multiple Disqualification tasks that use the same snapshot

    Details of the environment

    ======================

    Disqualification Version: 12.1.3.0.0


    A snapshot has been created in which the WHERE clause is outsourced and this snapshot table is used in a data quality process.

    Since there are different values passed to the WHERE clause, different jobs who have their own data quality process, but these process reads from the same snapshot table.

    Disqualification does not allow execution of different tasks that uses the same shot to run at the same time.

    Job1 is in operation, job2 throws an exception that the snapshot is locked.

    Any reason why Disqualification has this restriction? Processes are just doing a read on the snapshot table operation, so I was wondering why it was necessary to lock the object.

    We have more than 60 jobs that use the same snapshot and it would inhibit scalability if we are forced to run 60 jobs in sequence and not allow them to run in parallel.

    Can you advice how to fix this problem?

    The short answer is that each task must be executed with his own label of execution. Otherwise, each work is actually being run in the same context, and you will have problems of blocking.

    Please read on the labels of the execution and run profiles in the online help.

    Note that when running with a label of execution, complete results are not written; you need to decide exactly what to write work featuring the views of results you need. All data staged (including the snapshot itself) will be written with a label execution context and you can view the results in the Console of the server. Director will only show the results of the last run.

  • Calculation that uses the function Max Analytics

    Hello world

    Hope all is welll...
    I have 2 Calc:

    1) Calc_HippaToSortNumber who does:
    DECODE (hold desc, 'HIPAA', 999, NULL, 0, 500)

    2) Calc_MaxHoldDesc that uses the above calc in analytic function:
    Max (Calc_HippaToSortNumber) MORE (Student.Id PARTITION)

    I have a condition that uses the two Calc for:
    Select the line that corresponds to the max value of Calc by partition

    Calc_HippaToSortNumber = Calc_MaxHoldDesc

    I get the results I want, but I do not understand how works Discoverer:
    Calc 1 - should be the level of the detail line to assign a number based on a field to hold alpha Desc
    If keep Desc = Hippa, 999
    = Null, 0
    other values, 500

    Calc 2 - is an analytic function, so it happens after query calculates its results in detail

    BUT THE condition is testing the analytical function: this condition runs after the execution of the analytical function
    against all preliminary results?
    How does he know Scout to perform the function after execution of the analytical function
    instead of on the level of detail / row?

    The following test data:
    pls advise, tx, sandra

    ID take Fname Lname desc calc_HippatoSortNumber
    ==============================================================
    1 adams alice Certification BLS 500 max (500)
    2 Brown brett HIPAA 999 max (999)
    4 BLS Certification 500 Caroline Chin
    4 Caroline HIPAA 999 (999) max Chin

    I want to show only 3 lines using the analytical function max for the id field studying and comparing each
    the partition to the max value line and by selecting the line with the max value.
    1 adams alice BLS Certification 500
    2 Brown brett HIPAA 999
    4 Caroline HIPAA 999 Chin

    Hello

    How does he know Scout to perform the function after execution of the analytical function

    instead of on the level of detail / row?
    Discoverer always runs the latest analytical functions and therefore conditions by using analytical functions are also processed last. Discoverer for this by using a query online and therefore the structure of the SQLused

    Select Lname, Id, Calc_MaxHoldDesc, Calc_HippaToSortNumber)
    SELECT Id, Lname, DECODE (hold desc, 'HIPAA', 999, NULL, 0, 500)
    Calc_HippaToSortNumber, MAX (DECODE (hold desc, 'HIPAA', 999, NULL, 0, 500))
    ) Calc_MaxHoldDesc OVER (PARTITION BY Student.Id)
    Of...
    )
    WHERE Calc_HippaToSortNumber = Calc_MaxHoldDesc

    Rod West

  • I got a CD with a file that has the extension .mdb. What are my options to open and view this file? Secondly, the recommendation for pc virus protection?

    I have a HP with Windows Vista Premium installed.  I got a CD with a file that has the extension .mdb.   What are my options to open and view this file?    There is a second file on the disk with an extension .ldb.   What kind of file is it?

    Second, the recommendations that you offer for pc virus protection?   My coverage of Trend Micro systems allows access to the Explorer after I disable add ons... while I am limited with respect to the capabilities of the computer.

    Thank you!

    .Mdb and .ldb file extensions are used by the Microsoft Access database program. .mdb is a .ldb file is a lock file. You may be able to consult the data base with Access runtime, downloadable here:

    http://www.Microsoft.com/downloads/en/details.aspx?FamilyId=d9ae78d9-9DC6-4b38-9fa6-2c745a175aed&displaylang=en

    For an antivirus that doesn't interfere too much, try Microsoft Security Essentials:http://www.microsoft.com/security_essentials/?mkt=en-us . Ensure that anti-virus programs are completely removed, with vendors removal tool, preferably before installation.

  • are there any current HP printers that use the HP 02 print cartridges? Old printer C6180 goes wrong.

    are there any current HP printers that use the HP 02 print cartridges? Old Photosmart C6180 printer goes wrong and have a lot of cartridges.

    The Site of HP Pageyield lists the following printers compatible with 02 cartridges:

    I do not believe there are all the models currently available that use cartridge 02.

    I heard that HP has (had?) a trade-in program for its intact packaging expired cartridges.  See this post for a suggestion.

  • Routing between sites that use the site to site VPN

    I'm running 7.2 (1) two 515 who have a VPN site-to-site set up a bit as follows:

    subnets of the main site - router main site - PIX1___Public IP's___PIX2 - remote site

    The main site router: CAT6506 with engine SUP1A

    Subnets listed in motor SUP:

    SUB1 VLAN

    IP address 180.x.1.x.255.254.0

    VLAN SUB2

    IP address 180.x.2.x.255.254.0

    VLAN SUB3

    IP address 180.x.3.x.255.254.0

    VLAN SUB4

    IP address 180.x.4.x.255.255.240

    PIX1 is the subnet SUB4 (180.20.4.2)

    Remote site subnet: 192.168.1.0/24

    Route the engine by default Overtime toward another router that reached the internet via another public IP subnet.

    Any host on SUB4 can reach any host on the remote site as long as the SUB4 host default gateway is the inside int PIX1 (180.20.4.2).

    No matter what SUB4 host that uses the 180.20.4.1 address (router) default gateway cannot communicate with a remote host, but can communicate with any host from any subnet of the main site.

    All remote hosts can communicate with any host on SUB4, regardless of the gateway of the SUB4 host address.

    All remote hosts can communicate with the router on SUB4 main site, but can not reach one of the other interfaces subnet configured on the router.

    I've added a static route on the SUP engine:

    router IP 192.168.1.0 255.255.255.0 180.20.4.2

    That did not help.

    The uses of motor SUP EIGRP to learn other subnets main site reached through routers, so I added the remote subnet to that:

    Router eigrp 10

    redistribute static

    network 180.20.0.0

    network 192.168.1.0

    No Auto-resume

    No log-neighbor-changes to eigrp

    No chance, no more.

    I can't help thinking that I'm missing something very basic.

    Any help is really appreciated

    Hello

    PLS, find the changes that must be made and checked.

    PIX remotely:

    1. you only need a default route and that you can route your subnets via inside as they are outside, so remove these statements

    2.i see Access-group configured to be applied to the external interface for traffic coming from the outside, make sure that all required subnets are allowed.

    3. in the access list for the corresponding traffic to cryptomap, I see that one included subnet, pls have all included traffic that must be encrypted (as sub1, sub2..)

    Main PIX:

    1. in the access list for the corresponding traffic to cryptomap, I see that one included subnet, pls have all included traffic that must be encrypted (as sub1, sub2..)

    2. is there an 'access-group outside_access_in' access list present in the pix the corresponding traffic - check - the pls

    3. by nat (inside) 0 access-list inside_nat0_outbound, include all your inside subnets that must have access to the remote subnet

    L3 switch:

    1.I see a default route pointing to your router 3640, so pls add a static route to your remote subnet pointing to Pix

    IP route 192.168.1.0 255.255.255.0 x.x.22.2

    2. pls check in your L3 switch, wheter the appropriate subnets sub1, sub2 are learned properly via the conifugred Eigrp VLAN respective

    for example .sub2 and sub3 learning with leap following 8.2, sub 5 via 30.3

    Pls try to understand the topology and make configuration changes and let us know the results

    concerning

    k VB

  • I've created a form that uses the value field text to fill the text of another field.  Does not take into account changes

    I've created a form that uses the value field text to fill the text of another field.  However, if I need to change the text, the second field does not update this change.  Instead of reset the form each time, is the Javascript code to update the fields if they have been modified?

    For example I Text1 and Text2.

    When I type in Hello in Text1 I see Hello in Text2.

    Later, if I decide to change to Goodbye Text1, Text2 remains Hello.

    The shape of the hoe can recognize this change?

    Thank you

    Edit: I think I have misunderstood the situation.

    If you want to both fields have the same value, just to give them the same name.

  • My Webcam has problems detected by Skype and repeat myself there is another program that uses the webcam. Skype device code 43 usb video.

    My Webcam has problems detected by Skype and repeat myself there is another program that uses the webcam.

    Also got the guests when using Skype as a video device usb was not detected and that it is a code 43.

    Have tried several way sto resolve this problem. CyberLink YouCam HP's running came preloaded on the laptop. The webcam is running when this program is being used separately.

    Inappropriate Feedback Forum of Windows hardware and drivers Forum.

    My Webcam has problems detected by Skype and repeat myself there is another program that uses the webcam.

    Also got the guests when using Skype as a video device usb was not detected and that it is a code 43.

    Have tried several way sto resolve this problem. CyberLink YouCam HP's running came preloaded on the laptop. The webcam is running when this program is being used separately.

    Inappropriate Feedback Forum of Windows hardware and drivers Forum.

    Hello, Aadi467,

    A device driver has notified the operating system that the device failed.

    Run the diagnostic tool of hardware devices do not work or are not detected in Windows on the Microsoft Fix it Center.

    You can also uninstall the software from Cyberlink.  There is a found here download link to reinstall the software after restarting the computer.

    http://h30434.www3.HP.com/T5/notebook-operating-systems-and/lost-my-CyberLink-and-UCAM/TD-p/760367

  • printing with printer deskjet 2050 using the black cartridge only

    printing with printer deskjet 2050 using the black cartridge only

    all solutions? PLIs answer me. thanx

    Hi d33com,

    Follow the steps below to set the black ink only.

    1. open the printing preferences (step 1)

    2. click on the Advanced button (step 2)

    3. click on the drop down arrow next to the print in grayscale to change black ink only.

  • I'm trying to follow the video to "Change color" and I don't have a lot of options that uses the presenter.  I'm on a PC.  Can someone walk me by changing the color of an object step by step?

    I'm trying to follow the video to "Change color" and I don't have a lot of options that uses the presenter.  I'm on a PC.  Can someone walk me by changing the color of an object step by step?

    Sorry for the delay. Here is the video

  • Applications that use the non-public API will be rejected

    Hi guys

    Just read the iOS guidelines before getting too deep into the manufacturing of the native version of a web application.

    I was wondering what:

    Applications that use the non-public API will be rejected

    We hear when to submit an application in AIR - does that mean that you can not use your own custom classes?

    See you soon

    If you mean custom AS3 classes, Yes, you can use those. What you can't do, is create a DONKEY who calls in the frames of the iOS itself.

Maybe you are looking for